From 74f583847fb108593101a34ed88a13005a2252fb Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 3 Nov 2025 20:51:20 +0100 Subject: LaTeX reader: fix bugs in raw LaTeX parsing. Fix `rawTeXParser`. Make macro expansion in raw LaTeX depend on the setting of the `latex_macros` extension. Previously macros were always expanded, even in raw TeX in markdown. In addition, there was previously a bug that caused content to be garbled in certain cases. Closes #11253. Handle `ifstrequal` at a lower level, like the other `if` commands. See #11253. --- test/command/11253.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/command/11253.md (limited to 'test') diff --git a/test/command/11253.md b/test/command/11253.md new file mode 100644 index 000000000..cc10d8bc0 --- /dev/null +++ b/test/command/11253.md @@ -0,0 +1,27 @@ +``` +% pandoc -f markdown -t native +\ifstrequal{hello}{hello}{TRUE}{FALSE} +\ifstrequal{hello}{world}{TRUE}{FALSE} +^D +[ Para + [ RawInline (Format "tex") "TRUE" + , SoftBreak + , RawInline (Format "tex") "FALSE" + ] +] +``` + +``` +% pandoc -f markdown-latex_macros -t native +\ifstrequal{hello}{hello}{TRUE}{FALSE} +\ifstrequal{hello}{world}{TRUE}{FALSE} +^D +[ Para + [ RawInline + (Format "tex") "\\ifstrequal{hello}{hello}{TRUE}{FALSE}" + , SoftBreak + , RawInline + (Format "tex") "\\ifstrequal{hello}{world}{TRUE}{FALSE}" + ] +] +``` -- cgit v1.2.3