Closed Witiko closed 3 weeks ago
With the hybrid option disabled, a backslash (\) at the end of a document produces the command \markdownRendererBackslash, as expected:
hybrid
\
\markdownRendererBackslash
$ docker run --rm -i witiko/markdown markdown-cli hybrid=false <<< 'foo \'$'\n''bar \'
\markdownRendererDocumentBegin foo\markdownRendererHardLineBreak {}bar \markdownRendererBackslash{}\markdownRendererDocumentEnd
$ docker run --rm -i witiko/markdown markdown-cli hybrid=false <<< 'foo'$'\n\n''bar \'
\markdownRendererDocumentBegin foo\markdownRendererParagraphSeparator {}bar \markdownRendererBackslash{}\markdownRendererDocumentEnd
With the hybrid option enabled, a backslash (\) at the end of a document should produce a literal backslash:
\markdownRendererDocumentBegin foo\markdownRendererHardLineBreak {}bar \\markdownRendererDocumentEnd
\markdownRendererDocumentBegin foo\markdownRendererParagraphSeparator {}bar \\markdownRendererDocumentEnd
However, it produces the following output instead:
$ docker run --rm -i witiko/markdown markdown-cli hybrid=true <<< 'foo \'$'\n''bar \'
\markdownRendererDocumentBegin nil\markdownRendererDocumentEnd
$ docker run --rm -i witiko/markdown markdown-cli hybrid=true <<< 'foo'$'\n\n''bar \'
\markdownRendererDocumentBegin foo\markdownRendererDocumentEnd
As you can see, with the hybrid option enabled, a backslash at the end of a document breaks the conversion of the whole last paragraph, potentially replacing the paragraph with the text nil.
nil
With the
hybrid
option disabled, a backslash (\
) at the end of a document produces the command\markdownRendererBackslash
, as expected:With the
hybrid
option enabled, a backslash (\
) at the end of a document should produce a literal backslash:However, it produces the following output instead:
As you can see, with the
hybrid
option enabled, a backslash at the end of a document breaks the conversion of the whole last paragraph, potentially replacing the paragraph with the textnil
.