mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-27 09:55:57 +00:00
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.
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user