From 12ae1df5bfa447f94d8a3db24dd890e54bcbcf55 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 6 Apr 2017 11:30:03 +0200 Subject: 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. --- src/Text/Pandoc/Readers/Markdown.hs | 3 ++- test/command/3558.md | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 test/command/3558.md 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"]] +``` -- cgit v1.2.3