\textcolor will be parse as span at the beginning of a paragraph

This commit is contained in:
Marc Schreiber 2017-05-04 16:48:27 +02:00
parent 1728d4e609
commit 4ed6d91656
2 changed files with 8 additions and 1 deletions

View file

@ -420,7 +420,7 @@ blockTextcolor :: PandocMonad m => LP m Blocks
blockTextcolor = do
skipopts
color <- braced
divWith ("",[],[("style","color: " ++ color)]) <$> grouped block
divWith ("",[],[("style","color: " ++ color)]) <$> grouped block <* notFollowedBy inline
graphicsPath :: PandocMonad m => LP m Blocks
graphicsPath = do

View file

@ -5,6 +5,13 @@ Hello \textcolor{red}{World}
[Para [Str "Hello",Space,Span ("",[],[("style","color: red")]) [Str "World"]]]
```
```
% pandoc -f latex -t native
\textcolor{red}{Hello} World
^D
[Para [Span ("",[],[("style","color: red")]) [Str "Hello"],Space,Str "World"]]
```
```
% pandoc -f latex -t native
Hello \textcolor{blue}{\textbf{World}}