Skip to content

Commit

Permalink
Do not preserve trailing spaces when testing ConTeXt
Browse files Browse the repository at this point in the history
  • Loading branch information
Witiko committed Aug 3, 2023
1 parent 6d51fbb commit 1ae1639
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 6 additions & 4 deletions markdown.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -33405,9 +33405,11 @@ end
% \end{markdown}
% \begin{macrocode}
\startluacode
document.markdown_buffering = false
document.markdown_preserve_trailing_spaces = true
document.markdown_is_buffering = false
local function preserve_trailing_spaces(line)
if document.markdown_buffering then
if document.markdown_is_buffering and
document.markdown_preserve_trailing_spaces then
line = line:gsub("[ \t][ \t]$", "\t\t")
end
return line
Expand All @@ -33418,11 +33420,11 @@ end
\catcode`\|=0%
\catcode`\\=12%
|gdef|startmarkdown{%
|ctxlua{document.markdown_buffering = true}%
|ctxlua{document.markdown_is_buffering = true}%
|markdownReadAndConvert{\stopmarkdown}%
{|stopmarkdown}}%
|gdef|stopmarkdown{%
|ctxlua{document.markdown_buffering = false}%
|ctxlua{document.markdown_is_buffering = false}%
|markdownEnd}%
|endgroup
% \end{macrocode}
Expand Down
2 changes: 2 additions & 0 deletions tests/templates/context-mkiv/verbatim/body.tex.m4
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
% Prevent the folding of characters into a single space token in logs.
\catcode"09=12% Tabs (U+0009)
\catcode"20=12% Spaces (U+0020)
% Do not preserve trailing spaces in input buffer for parity with other TeX formats.
\ctxlua{document.markdown_preserve_trailing_spaces = false}
% Disable active characters of the TeX engine.
\catcode"7E=12% Tildes (U+007E)
\catcode"7C=12% Pipes (U+007C)
Expand Down

0 comments on commit 1ae1639

Please sign in to comment.