Muse reader: don't allow footnote references inside links
This commit is contained in:
parent
17767bd29d
commit
01f5ed14e6
2 changed files with 5 additions and 0 deletions
|
@ -822,6 +822,8 @@ anchor = try $ do
|
|||
-- | Parse a footnote reference.
|
||||
footnote :: PandocMonad m => MuseParser m (F Inlines)
|
||||
footnote = try $ do
|
||||
inLink <- museInLink <$> getState
|
||||
guard $ not inLink
|
||||
ref <- noteMarker
|
||||
return $ do
|
||||
notes <- asksF museNotes
|
||||
|
|
|
@ -210,6 +210,9 @@ tests =
|
|||
, "No implicit links" =: "http://example.org/index.php?action=view&id=1"
|
||||
=?> para "http://example.org/index.php?action=view&id=1"
|
||||
, "Link with empty URL" =: "[[][empty URL]]" =?> para (link "" "" (text "empty URL"))
|
||||
, "No footnotes inside links" =:
|
||||
"[[https://amusewiki.org/][foo[1]]" =?>
|
||||
para (link "https://amusewiki.org/" "" (text "foo[1"))
|
||||
]
|
||||
|
||||
, testGroup "Literal"
|
||||
|
|
Loading…
Add table
Reference in a new issue