Markdown reader: don't allow ^ at beginning of link or image label.

This is reserved for footnotes.
Fixes a regression introduced by 0a93acf.

Closes #7723.
This commit is contained in:
John MacFarlane 2021-11-30 12:53:54 -08:00
parent 6e712fa10a
commit 619dfa2a2a
2 changed files with 9 additions and 2 deletions

View file

@ -1775,8 +1775,7 @@ endline = try $ do
-- a reference label for a link
reference :: PandocMonad m => MarkdownParser m (F Inlines, Text)
reference = do
-- guardDisabled Ext_footnotes <|> notFollowedBy' (string "[^")
-- guardDisabled Ext_citations <|> notFollowedBy' (string "[@")
guardDisabled Ext_footnotes <|> notFollowedBy' (string "[^")
withRaw $ trimInlinesF <$> inlinesInBalancedBrackets
parenthesizedChars :: PandocMonad m => MarkdownParser m Text

8
test/command/7723.md Normal file
View file

@ -0,0 +1,8 @@
```
% pandoc -t native
Bug![^1]
[^1]: Note.
^D
[ Para [ Str "Bug!" , Note [ Para [ Str "Note." ] ] ] ]
```