git.iko.soy/typeable/pandoc
on master help sign in
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.

commit12ae1df5bfa447f94d8a3db24dd890e54bcbcf55 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 6 Apr 2017, 11:30 (10 years ago) parent12a3481
2 files changed+10−1
src/Text/Pandoc/Readers/Markdown.hs+2−1 test/command/3558.md+8
src/Text/Pandoc/Readers/Markdown.hs+2−1
@@ -1912,7 +1912,8 @@ inlineNote = try $ do
19121912rawLaTeXInline' :: PandocMonad m => MarkdownParser m (F Inlines)
19131913rawLaTeXInline' = try $ do
19141914 guardEnabled Ext_raw_tex
1915− lookAhead $ char '\\' >> notFollowedBy' (string "start") -- context env
1915+ lookAhead (char '\\')
1916+ notFollowedBy' rawConTeXtEnvironment
19161917 RawInline _ s <- rawLaTeXInline
19171918 return $ return $ B.rawInline "tex" s
19181919 -- "tex" because it might be context or latex
test/command/3558.mdnew file+8
@@ -0,0 +1,8 @@
1+```
2+% pandoc -t native
3+\startmulti
4+hello
5+\endmulti
6+^D
7+[Para [RawInline (Format "tex") "\\startmulti\n",Str "hello",SoftBreak,RawInline (Format "tex") "\\endmulti"]]
8+```