LINEBREAK_RULEconstant
Hard linebreak (<br /> tag).
- Any
\nlinebreak in a paragraph will become a hard<br />tag. - Leading and trailing whitespace before/after the linebreak is trimmed.
- Different to Markdown:
- Markdown needs two spaces at the end of a line to create a linebreak.
- We just directly convert any
\nlinebreak into a<br />tag (lines without two spaces are not joined together).- This is more intuitive (a linebreak becomes a linebreak is isn't silently ignored).
- This works better with textareas that wrap text (since manually breaking up long lines is no longer necessary).
- This is more intuitive (a linebreak becomes a linebreak is isn't silently ignored).
- We just directly convert any
- Markdown needs two spaces at the end of a line to create a linebreak.
Examples
new MarkupParser({ rules: [LINEBREAK_RULE] }).parse("Line one\nLine two")