aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-09-28 11:53:19 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-09-28 11:53:34 -0700
commit9e7072cf1bf9d2e786a9e49ae144b0e625f66c87 (patch)
tree946cc39335bc0a07b8a9a38b8f7f73c94535c146 /src
parentb97f1136cd089c17123a264a8b3e0fcf657fc5fc (diff)
downloadpandoc-9e7072cf1bf9d2e786a9e49ae144b0e625f66c87.tar.gz
LaTeX reader: Parse {groups} as Span.
This is needed for accurate conversion of bibtex titles, since we need to know what was protected from titlecase conversions.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index ff5b73348..cf5119345 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -176,7 +176,7 @@ inline = (mempty <$ comment)
<|> (space <$ sp)
<|> inlineText
<|> inlineCommand
- <|> grouped inline
+ <|> inlineGroup
<|> (char '-' *> option (str "-")
((char '-') *> option (str "–") (str "—" <$ char '-')))
<|> double_quote
@@ -199,6 +199,15 @@ inline = (mempty <$ comment)
inlines :: LP Inlines
inlines = mconcat <$> many (notFollowedBy (char '}') *> inline)
+inlineGroup :: LP Inlines
+inlineGroup = do
+ ils <- grouped inline
+ if isNull ils
+ then return mempty
+ else return $ spanWith nullAttr ils
+ -- we need the span so we can detitlecase bibtex entries;
+ -- we need to know when something is {C}apitalized
+
block :: LP Blocks
block = (mempty <$ comment)
<|> (mempty <$ ((spaceChar <|> newline) *> spaces))