Default anchorPattern
selects too many links when URI contains (fn|footnote|note)
#1824
Labels
anchorPattern
selects too many links when URI contains (fn|footnote|note)
#1824
The default
anchorPattern
is/(fn|footnote|note)[:\-_\d]/gi
. This could select too many links when the URI of the page contains the stringsfn
,footnote
, ornote
.For example, a page containing the following element is served at
https://footnote.example.com/
:Then in the following code,
pattern
will match becauselink.href
ishttps://footnote.example.com/#
littlefoot/src/dom/document.ts
Lines 69 to 71 in b2f470f
I believe this can be fixed by setting the default
anchorPattern
to/#(fn|footnote|note)[:\-_\d]/gi
The text was updated successfully, but these errors were encountered: