git.iko.soy/typeable/pandoc
on master help sign in
Add suggestions of @jgm: parse bracketed stuff as inlines
29a4bdcMarc Schreiber
src/Text/Pandoc/Readers/LaTeX.hs+9−3
@@ -418,9 +418,15 @@ blockCommands = M.fromList $
418
418
419blockTextcolor :: PandocMonad m => LP m Blocks
419blockTextcolor :: PandocMonad m => LP m Blocks
420blockTextcolor = do
420blockTextcolor = do
421− skipopts
421+ skipopts
422− color <- braced
422+ color <- braced
423− divWith ("",[],[("style","color: " ++ color)]) <$> grouped block <* notFollowedBy inline
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
424
430
425graphicsPath :: PandocMonad m => LP m Blocks
431graphicsPath :: PandocMonad m => LP m Blocks
426graphicsPath = do
432graphicsPath = do
test/command/textcolor.md+17
@@ -33,3 +33,20 @@ Hello \textcolor{blue}{\textbf{World}}
33 [[Para [Str "Item",Space,Str "1"]]
33 [[Para [Str "Item",Space,Str "1"]]
34 ,[Para [Str "Item",Space,Str "2"]]]]]
34 ,[Para [Str "Item",Space,Str "2"]]]]]
35```
35```
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+