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 <br> is turned into a Linebreak element:

pandoc -f html -t native
test <br/>
[ 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 <br> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ee3c85ef-c9ca-473c-9df8-b18be45cc6abn%40googlegroups.com.