Two hard breaks in a row read back as a paragraph break. Found while working on #204; reproduced on main:
| storage |
read writes |
publish sends |
<p>a<br /><br />b</p> |
a␣␣\n␣␣\nb |
<p>a</p><p>b</p> |
The second break's own two spaces make a line that holds nothing but whitespace, and Markdown reads that as a blank line, so one paragraph comes back as two. The editor writes this shape for Shift+Enter pressed twice.
Since #204 the same happens when a <br /> at the end of a bold run is followed by a <br /> (<p><strong>a<br /></strong><br />b</p>), because the edge break now moves out of the mark instead of being dropped.
Notes
- A backslash hard break survives on a line of its own:
a␣␣\n\\\nb publishes as <p>a<br />\n<br />\nb</p>. So the fix is probably to write every break after the first in a run as \ + newline.
- Breaks are compared and trimmed as the literal
" \n" in several places (renderInlineRun, renderMark's edge trim, renderCellLines' <br> substitution, the heading's <br /> substitution), so each place needs to recognise the second spelling too. Otherwise a mark's edge trim stops at the backslash.
Two hard breaks in a row read back as a paragraph break. Found while working on #204; reproduced on
main:<p>a<br /><br />b</p>a␣␣\n␣␣\nb<p>a</p><p>b</p>The second break's own two spaces make a line that holds nothing but whitespace, and Markdown reads that as a blank line, so one paragraph comes back as two. The editor writes this shape for Shift+Enter pressed twice.
Since #204 the same happens when a
<br />at the end of a bold run is followed by a<br />(<p><strong>a<br /></strong><br />b</p>), because the edge break now moves out of the mark instead of being dropped.Notes
a␣␣\n\\\nbpublishes as<p>a<br />\n<br />\nb</p>. So the fix is probably to write every break after the first in a run as\+ newline." \n"in several places (renderInlineRun,renderMark's edge trim,renderCellLines'<br>substitution, the heading's<br />substitution), so each place needs to recognise the second spelling too. Otherwise a mark's edge trim stops at the backslash.