On the other hand soft breaks are dropped when writing. For example:
printf "a\nb" | pandoc -f markdown -t markdown
Results in this, notice how SoftBreak is lost, it's rendered as a space:
a b
Is this an issue?
The question is if this is an issue at all. Markdown allows breaking lines without affecting the semantics, so it's logical that they aren't preserved when writing. But if this is the case, then why is it generated when reading, shouldn't it be ignored as a markdown formatting details without any meaning? I may be missing why SoftBreak even exists in Pandoc when LineBreak is there, is it there to support preserving markdown formatting during conversions between formats supporting it?
Reading works
Pandoc handles soft breaks when reading markdown. For example:
Results in this, notice the
SoftBreak
element:Writing doesn't work
On the other hand soft breaks are dropped when writing. For example:
Results in this, notice how
SoftBreak
is lost, it's rendered as a space:Is this an issue?
The question is if this is an issue at all. Markdown allows breaking lines without affecting the semantics, so it's logical that they aren't preserved when writing. But if this is the case, then why is it generated when reading, shouldn't it be ignored as a markdown formatting details without any meaning? I may be missing why
SoftBreak
even exists in Pandoc whenLineBreak
is there, is it there to support preserving markdown formatting during conversions between formats supporting it?Pandoc version?
pandoc 3.1.13 Linux