summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/generic/markdown/markdown.dtx69
1 files changed, 43 insertions, 26 deletions
diff --git a/Master/texmf-dist/source/generic/markdown/markdown.dtx b/Master/texmf-dist/source/generic/markdown/markdown.dtx
index f035985ca80..d32712738b9 100644
--- a/Master/texmf-dist/source/generic/markdown/markdown.dtx
+++ b/Master/texmf-dist/source/generic/markdown/markdown.dtx
@@ -597,7 +597,7 @@ documentation][techdoc].
% \fi
% \begin{macrocode}
local metadata = {
- version = "2.10.0",
+ version = "2.10.1",
comment = "A module for the conversion from markdown to plain TeX",
author = "John MacFarlane, Hans Hagen, Vít Novotný",
copyright = {"2009-2016 John MacFarlane, Hans Hagen",
@@ -5796,6 +5796,8 @@ defaultOptions.tableCaptions = false
\end{document}
```````
+ Always enabled when \Opt{hybrid} is enabled.
+
: false
: Do not strip \TeX{}-style comments.
@@ -6338,8 +6340,8 @@ pdftex --shell-escape document.tex
%
% \end{markdown}
% \begin{macrocode}
-\def\markdownLastModified{2021/08/06}%
-\def\markdownVersion{2.10.0}%
+\def\markdownLastModified{2021/08/31}%
+\def\markdownVersion{2.10.1}%
% \end{macrocode}
% \par
% \begin{markdown}
@@ -15402,29 +15404,45 @@ parsers.spnl = parsers.optionalspace
parsers.line = parsers.linechar^0 * parsers.newline
parsers.nonemptyline = parsers.line - parsers.blankline
-parsers.commented_line = Cs(((parsers.linechar -- initial
- - parsers.backslash
- - parsers.percent)^1
- + (parsers.backslash -- even backslash
- * parsers.backslash)^1
- + (parsers.backslash -- odd backslash
- * parsers.backslash)^0
- * (parsers.backslash / ""
- * parsers.percent
- + parsers.backslash
- * (parsers.linechar -- initial
- + parsers.newline
- - parsers.backslash
- - parsers.percent))
- )^0)
+parsers.commented_line_letter = parsers.linechar
+ + parsers.newline
+ - parsers.backslash
+ - parsers.percent
+parsers.commented_line = Cg(Cc(""), "backslashes")
+ * ((#(parsers.commented_line_letter
+ - parsers.newline)
+ * Cb("backslashes")
+ * Cs(parsers.commented_line_letter
+ - parsers.newline)^1 -- initial
+ * Cg(Cc(""), "backslashes"))
+ + #(parsers.backslash * parsers.backslash)
+ * Cg((parsers.backslash -- even backslash
+ * parsers.backslash)^1, "backslashes")
+ + (parsers.backslash
+ * (#parsers.percent
+ * Cb("backslashes")
+ / function(backslashes)
+ return string.rep("\\", #backslashes / 2)
+ end
+ * C(parsers.percent)
+ + #parsers.commented_line_letter
+ * Cb("backslashes")
+ * Cc("\\")
+ * C(parsers.commented_line_letter))
+ * Cg(Cc(""), "backslashes")))^0
+ * (#parsers.percent
+ * Cb("backslashes")
+ / function(backslashes)
+ return string.rep("\\", #backslashes / 2)
+ end
* ((parsers.percent -- comment
* parsers.line
* #parsers.blankline) -- blank line
- / "\n"
+ / "\n"
+ parsers.percent -- comment
* parsers.line
- * parsers.optionalspace -- leading tabs and spaces
- + C(parsers.newline))
+ * parsers.optionalspace) -- leading tabs and spaces
+ + C(parsers.newline))
parsers.chunk = parsers.line * (parsers.optionallyindentedline
- parsers.blankline)^0
@@ -16238,16 +16256,15 @@ function M.reader.new(writer, options)
% \par
% \begin{markdown}
%
-% If the parser is top-level and the \Opt{texComments} Lua option is
-% enabled, we will strip all plain \TeX{} comments from the input string `str`
-% together with the trailing newline characters.
+% If the parser is top-level and the \Opt{texComments} or \Opt{hybrid} Lua
+% options are enabled, we will strip all plain \TeX{} comments from the input
+% string `str` together with the trailing newline characters.
%
% \end{markdown}
% \begin{macrocode}
- if toplevel and options.texComments then
+ if toplevel and (options.texComments or options.hybrid) then
str = lpeg.match(Ct(parsers.commented_line^1), str)
str = util.rope_to_string(str)
- print(str)
end
local res = lpeg.match(grammar(), str)
if res == nil then