Open zturtleman opened 3 months ago
@zturtleman
What should be the right output of this?
<!-- wp:paragraph -->
<p>First line<br />Second line<br />Third line</p>
<!-- /wp:paragraph -->
As far as I know, there is no standard way to add non-paragraph line breaks in markdown.
For context, \<br /> are generated by WordPress in paragraphs using shift+enter.
From the Markdown standard:
When you do want to insert a \<br /> break tag using Markdown, you end a line with two or more spaces, then type return.
Converting this HTML to Markdown:
<!-- wp:paragraph -->
<p>First line<br />Second line<br />Third line</p>
<!-- /wp:paragraph -->
Should be this Markdown (with two spaces at the end of the first two lines):
First line
Second line
Third line
Using + to visual spaces, it would look like this:
First line++
Second line++
Third line
Though the Markdown itself should use spaces, not +.
Thanks. Would you like to send a PR @zturtleman ?
I provided more explanation on an issue for the underlying library. I'm not planning to submit on a PR. It's not urgent for me personally.
A list using
<br />
to separate lines in WordPress does not display line breaks in the generated Markdown. Adding two spaces to the end of lines with<br />
forces a line break to be displayed. Markdown referenceWordPress XML export:
First line
Second line
Third line
Generated by wp2hugo:
First line Second line Third line
Adding two spaces to the end of lines with
<br />
forces a line break to be displayed:First line
Second line
Third line