git.iko.soy/typeable/pandoc
on master help sign in
Add suggestions of @jgm: parse bracketed stuff as inlines
commit29a4bdc68131d3925a55e0428b35c6a4f75f86e0 authorMarc Schreiber <schrieveslaach@online.de> dateTue 23 May 2017, 17:31 (9 years ago) parent4ed6d91
2 files changed+26−3
src/Text/Pandoc/Readers/LaTeX.hs+9−3 test/command/textcolor.md+17
src/Text/Pandoc/Readers/LaTeX.hs+9−3
@@ -418,9 +418,15 @@ blockCommands = M.fromList $
418418
419419blockTextcolor :: PandocMonad m => LP m Blocks
420420blockTextcolor = do
421− skipopts
422− color <- braced
423− divWith ("",[],[("style","color: " ++ color)]) <$> grouped block <* notFollowedBy inline
421+ skipopts
422+ color <- braced
423+ let constructor = divWith ("",[],[("style","color: " ++ color)])
424+ inlineContents <|> constructor <$> blockContents
425+ where inlineContents = do
426+ ils <- grouped inline
427+ rest <- inlines
428+ return (para (ils <> rest))
429+ blockContents = grouped block
424430
425431graphicsPath :: PandocMonad m => LP m Blocks
426432graphicsPath = do
test/command/textcolor.md+17
@@ -33,3 +33,20 @@ Hello \textcolor{blue}{\textbf{World}}
3333 [[Para [Str "Item",Space,Str "1"]]
3434 ,[Para [Str "Item",Space,Str "2"]]]]]
3535```
36+
37+```
38+% pandoc -f latex -t native
39+\textcolor{blue}{
40+\begin{itemize}
41+ \item Item 1
42+ \item Item 2
43+\end{itemize}
44+} some more text
45+^D
46+[Div ("",[],[("style","color: blue")])
47+ [BulletList
48+ [[Para [Str "Item",Space,Str "1"]]
49+ ,[Para [Str "Item",Space,Str "2"]]]]
50+,Para [Str "some",Space,Str "more",Space,Str "text"]]
51+```
52+