Fix invalid link matcher

This commit is contained in:
Maxime Vaillancourt 2020-11-15 14:31:12 -05:00
parent f297a68cbf
commit a6e1a8d5e9

View File

@ -31,7 +31,7 @@ class BidirectionalLinksGenerator < Jekyll::Generator
# pointing to non-existing pages, so let's turn them into disabled
# links by greying them out and changing the cursor
current_note.content = current_note.content.gsub(
/\[\[?(.*)\]\]/i, # match on the remaining double-bracket links
/\[\[(.*)\]\]/i, # match on the remaining double-bracket links
<<~HTML.chomp # replace with this HTML (\\1 is what was inside the brackets)
<span title='There is no note that matches this title.' class='invalid-link'>
<span class='invalid-link-brackets'>[[</span>