aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-04-06 11:30:03 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-04-06 11:30:03 +0200
commit12ae1df5bfa447f94d8a3db24dd890e54bcbcf55 (patch)
tree47753976a96bf6e10aa57b7c31658b661ab5708d
parent12a3481632bfc3d477759095fa01fa92e169b292 (diff)
downloadpandoc-12ae1df5bfa447f94d8a3db24dd890e54bcbcf55.tar.gz
Allow raw latex commands starting with `\start` in Markdown.
Previously these weren't allowed because they were interpreted as starting ConTeXt environments, even without a corresponding \stop... Closes #3558.
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs3
-rw-r--r--test/command/3558.md8
2 files changed, 10 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 5f08afe08..9eb242d74 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1912,7 +1912,8 @@ inlineNote = try $ do
rawLaTeXInline' :: PandocMonad m => MarkdownParser m (F Inlines)
rawLaTeXInline' = try $ do
guardEnabled Ext_raw_tex
- lookAhead $ char '\\' >> notFollowedBy' (string "start") -- context env
+ lookAhead (char '\\')
+ notFollowedBy' rawConTeXtEnvironment
RawInline _ s <- rawLaTeXInline
return $ return $ B.rawInline "tex" s
-- "tex" because it might be context or latex
diff --git a/test/command/3558.md b/test/command/3558.md
new file mode 100644
index 000000000..3f4079064
--- /dev/null
+++ b/test/command/3558.md
@@ -0,0 +1,8 @@
+```
+% pandoc -t native
+\startmulti
+hello
+\endmulti
+^D
+[Para [RawInline (Format "tex") "\\startmulti\n",Str "hello",SoftBreak,RawInline (Format "tex") "\\endmulti"]]
+```