Skip to content

Commit

Permalink
Markdown reader: Simplify and fix normal citation parsing.
Browse files Browse the repository at this point in the history
Closes #10584.

This fixes a bug that causes some normal citations to be
parsed as bracketed regular citations.
  • Loading branch information
jgm committed Feb 1, 2025
1 parent 6fbb50f commit 8e18a81
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Text/Pandoc/Readers/Markdown.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2267,7 +2267,11 @@ bareloc c = try $ do

normalCite :: PandocMonad m => MarkdownParser m (F [Citation])
normalCite = try $ do
citations <- inBalancedBrackets (spnl *> citeList <* spnl)
char '['
spnl
citations <- citeList
spnl
char ']'
-- not a link or a bracketed span
notFollowedBy (try (void source) <|>
(guardEnabled Ext_bracketed_spans *> void attributes) <|>
Expand Down

0 comments on commit 8e18a81

Please sign in to comment.