git.iko.soy/typeable/pandoc
on master help sign in
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.

commit9e7072cf1bf9d2e786a9e49ae144b0e625f66c87 authorJohn MacFarlane <fiddlosopher@gmail.com> dateSat 28 Sep 2013, 11:53 (13 years ago) parentb97f113
1 file changed+10−1
src/Text/Pandoc/Readers/LaTeX.hs+10−1
src/Text/Pandoc/Readers/LaTeX.hs+10−1
@@ -176,7 +176,7 @@ inline = (mempty <$ comment)
176176 <|> (space <$ sp)
177177 <|> inlineText
178178 <|> inlineCommand
179− <|> grouped inline
179+ <|> inlineGroup
180180 <|> (char '-' *> option (str "-")
181181 ((char '-') *> option (str "–") (str "—" <$ char '-')))
182182 <|> double_quote
@@ -199,6 +199,15 @@ inline = (mempty <$ comment)
199199inlines :: LP Inlines
200200inlines = mconcat <$> many (notFollowedBy (char '}') *> inline)
201201
202+inlineGroup :: LP Inlines
203+inlineGroup = do
204+ ils <- grouped inline
205+ if isNull ils
206+ then return mempty
207+ else return $ spanWith nullAttr ils
208+ -- we need the span so we can detitlecase bibtex entries;
209+ -- we need to know when something is {C}apitalized
210+
202211block :: LP Blocks
203212block = (mempty <$ comment)
204213 <|> (mempty <$ ((spaceChar <|> newline) *> spaces))