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.
This commit is contained in:
John MacFarlane 2017-04-06 11:30:03 +02:00
parent 12a3481632
commit 12ae1df5bf
2 changed files with 10 additions and 1 deletions

View file

@ -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

8
test/command/3558.md Normal file
View file

@ -0,0 +1,8 @@
```
% pandoc -t native
\startmulti
hello
\endmulti
^D
[Para [RawInline (Format "tex") "\\startmulti\n",Str "hello",SoftBreak,RawInline (Format "tex") "\\endmulti"]]
```