Might be worth trying what happens if you return pandoc.Softbreak() instead of pandoc.Space() https://pandoc.org/lua-filters.html#pandoc.softbreak On Thursday, March 2, 2023 at 9:59:58 PM UTC JDTS wrote: > Update: I find that any number of \n's is swallowed, but \r is converted > to \n on org output. > > On Thursday, March 2, 2023 at 4:24:06 PM UTC-5 JDTS wrote: > >> Thanks again, something like this should work. I'd prefer to turn it into >> a regular newline, but haven't figure out how to do that. pandoc.str('\n') >> doesn't seem to result in any output. >> On Tuesday, February 28, 2023 at 9:13:14 AM UTC-5 Julien Dutant wrote: >> >>> Pandoc -f html -t native shows that
is turned into a Linebreak >>> element: >>> >>> pandoc -f html -t native >>> test
>>> [ Plain [ Str "test" , LineBreak ] ] >>> >>> So I'd use a filter that converts Linebreaks to Space. Save as >>> removeLinebreak.lua: >>> >>> function Linebreak (elem) >>> return pandoc.Space() >>> end >>> >>> Could be added to the previous one with >>> >>> return {{ >>> OrderedList = fixList, >>> BulletList = fixList, >>> Linebreak = replaceBySpace >>> }} >>> >>> I think replacing it with a space is the safest. To remove it entirely, >>> you couldn't return nil as Pandoc treats this as "leave unmodified". You'd >>> have to return an empty list instead, I think: >>> >>> function Linebreak (elem) >>> return pandoc.List:new() >>> end >>> >>> Best, >>> J >>> >>> On Tuesday, February 28, 2023 at 12:28:55 AM UTC JDTS wrote: >>> >>> One other quick question: pandoc parses
as linebreak, and >>> translates that into org as double-backslash \\. Any way to disable this? >>> >>> >>> -- 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/81f58aeb-ac35-45ab-a8f7-79da06619047n%40googlegroups.com.