Skip to content

Parsing "\\\n\n" loses the backslash #658

@mgeisler

Description

@mgeisler

Compare parsing "\\\n" and "\\\n\n":

"\\\n" -> [
  Start(Paragraph)
    Text(Borrowed("\\"))
  End(Paragraph)
]
"\\\n\n" -> [
  Start(Paragraph)
  End(Paragraph)
]

The backslash disappears when it is followed by two newlines.

The commonmark.js tool includes the backslash in both cases. The output of echo -n '\\\n\n' | commonmark --to xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document SYSTEM "CommonMark.dtd">
<document xmlns="http://commonmark.org/xml/1.0">
  <paragraph>
    <text>\</text>
  </paragraph>
</document>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions