public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: "christi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <christian.kolen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Normalize adjacent Emph separated by Space?
Date: Thu, 16 Dec 2021 17:25:09 -0800 (PST)	[thread overview]
Message-ID: <c887615c-9a1e-40a5-b6b0-a7bf22c87350n@googlegroups.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1976 bytes --]



Hi,

I recently have a situation that I want to have adjacent Emph separated by 
Space to be “normalized”, combined to a single Emph. (And variants like 
this.)

--normalize is removed in 
https://github.com/jgm/pandoc/commit/8165014df679338d5bf228d84efc742c5ac39d2 
and I’m not sure if it is related.

Example:

$ echo "*text* *abc*" | pandoc -f markdown -t native
[ Para [ Emph [ Str "text" ] , Space , Emph [ Str "abc" ] ]
]

Is there someway to make it

[ Para [ Emph [ Str "text" , Space , Str "abc" ] ] ]
]

Instead?

Another example is (perhaps generated in a filter)

[ Para [ Emph [ Str "text " ] , Emph [ Str "abc" ] ]]

Is there some way to normalize it to

[ Para [ Emph [ Str "text" ] , Space, Emph [ Str "abc" ] ]]

When I say “some way”, preferably it is some pandoc flags (for example 
native to markdown then markdown to native is not reliable for the space 
problem above and won’t work to merge adjacent Emph), but even if we’re 
talking about doing it in filter, how to do things like this reliably?

Thanks.

P.S.

Even for

[ Para [ Emph [ Str "text" ] , Emph [ Str "abc" ] ]]

won’t be normalized:

$ echo '[ Para [ Emph [ Str "text" ] , Emph [ Str "abc" ] ]]' | pandoc -f native -t native
[ Para [ Emph [ Str "text" ] , Emph [ Str "abc" ] ] ]

But the text in the commit message seems to suggest it should:

normalization is handled automatically by the Builder monoid instance.

(But the commit is old so may be there’s more to it in the later commits.)
​

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/c887615c-9a1e-40a5-b6b0-a7bf22c87350n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 16898 bytes --]

             reply	other threads:[~2021-12-17  1:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17  1:25 christi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org [this message]
     [not found] ` <c887615c-9a1e-40a5-b6b0-a7bf22c87350n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-12-17  2:49   ` John MacFarlane
     [not found]     ` <m2o85g6j3y.fsf-d8241O7hbXoP5tpWdHSM3tPlBySK3R6THiGdP5j34PU@public.gmane.org>
2021-12-17  4:32       ` christi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c887615c-9a1e-40a5-b6b0-a7bf22c87350n@googlegroups.com \
    --to=christian.kolen-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).