Skip to content

Commit

Permalink
Allow a backslash before a newline with the stripComments Lua option
Browse files Browse the repository at this point in the history
  • Loading branch information
Witiko committed Apr 10, 2021
1 parent 5f7c5e3 commit 744bcdb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions markdown.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -15211,6 +15211,7 @@ parsers.commented_line = Cs(((parsers.linechar
* parsers.percent
+ parsers.backslash
* (parsers.linechar
+ parsers.newline
- parsers.backslash
- parsers.percent))
)^0)
Expand Down
11 changes: 9 additions & 2 deletions tests/testfiles/lunamark-markdown/no-strip-comments.test
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<<<
This test ensures that the Lua `stripComments` option is disabled by default.
The following *emphasi% this is a comment
zed text* should be interrupted and this *emphasi\% another one

The following *emphasi% this is a comment
zed text* should be interrupted and this *emphasi\% another one
zed text* should also be interrupted.

A single backslash at the *end of \
a line* should be allowed by the preprocessor.
>>>
codeSpan: stripComments
interblockSeparator
emphasis: emphasi(percentSign) this is a comment zed text
emphasis: emphasi(backslash)(percentSign) another one zed text
interblockSeparator
emphasis: end of (backslash) a line
12 changes: 10 additions & 2 deletions tests/testfiles/lunamark-markdown/strip-comments.test
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
\def\markdownOptionStripComments{true}
<<<
This test ensures that the Lua `stripComments` option correctly propagates
through the plain TeX interface. The following *emphasi% this is a comment
zed text* should be uninterrupted, whereas this *emphasi\% another one
through the plain TeX interface.

The following *emphasi% this is a comment
zed text* should be uninterrupted, whereas this *emphasi\% another one
zed text* should be interrupted.

The following *emphasi% this is a comment

zed text* should be broken into two paragraphs.

A single backslash at the *end of \
a line* should be allowed by the preprocessor.
>>>
codeSpan: stripComments
interblockSeparator
emphasis: emphasized text
emphasis: emphasi(percentSign) another one zed text
interblockSeparator
interblockSeparator
interblockSeparator
emphasis: end of (backslash) a line

0 comments on commit 744bcdb

Please sign in to comment.