Add suggestions of @jgm: parse bracketed stuff as inlines

This commit is contained in:
Marc Schreiber 2017-05-23 17:31:42 -03:00
parent 4ed6d91656
commit 29a4bdc681
2 changed files with 26 additions and 3 deletions

View file

@ -418,9 +418,15 @@ blockCommands = M.fromList $
blockTextcolor :: PandocMonad m => LP m Blocks
blockTextcolor = do
skipopts
color <- braced
divWith ("",[],[("style","color: " ++ color)]) <$> grouped block <* notFollowedBy inline
skipopts
color <- braced
let constructor = divWith ("",[],[("style","color: " ++ color)])
inlineContents <|> constructor <$> blockContents
where inlineContents = do
ils <- grouped inline
rest <- inlines
return (para (ils <> rest))
blockContents = grouped block
graphicsPath :: PandocMonad m => LP m Blocks
graphicsPath = do

View file

@ -33,3 +33,20 @@ Hello \textcolor{blue}{\textbf{World}}
[[Para [Str "Item",Space,Str "1"]]
,[Para [Str "Item",Space,Str "2"]]]]]
```
```
% pandoc -f latex -t native
\textcolor{blue}{
\begin{itemize}
\item Item 1
\item Item 2
\end{itemize}
} some more text
^D
[Div ("",[],[("style","color: blue")])
[BulletList
[[Para [Str "Item",Space,Str "1"]]
,[Para [Str "Item",Space,Str "2"]]]]
,Para [Str "some",Space,Str "more",Space,Str "text"]]
```