Uploaded image for project: 'Markdown Syntax'
  1. Markdown Syntax
  2. MARKDOWN-107

New lines in headings or consecutive new lines are rendered incorrectly in CommonMark Markdown 1.2

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • 8.10.0
    • 8.9.1
    • markdown/1.2
    • None
    • Unknown

    Description

      When rendering to markdown/1.2, a new line is always rendered as two trailing spaces followed by a line break (a Markdown hard line break). This produces wrong Markdown in some contexts:

      • In a heading: ATX headings can't span several lines, so the text after the new line leaves the heading. E.g. xwiki/2.1 = a\\b = (or Markdown # a<br>b) is rendered as # a + 2 spaces, then b on the next line, which becomes a separate paragraph.
      • Consecutive new lines: e.g. xwiki/2.1 a\\\\b (or Markdown a<br><br>b) is rendered as a + 2 spaces, a line containing only 2 spaces, then b. A line with only spaces is a blank line, so the paragraph is split in two when parsed back.

      Expected

      The new lines are preserved inside the heading / paragraph (e.g. using <br/> where a hard line break can't be used, or a backslash hard line break).

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: