Skip to content

Conversation

foxblock
Copy link

Fixes #317 #318 #319

Some minor fixes allow links to headings in the same document [[#heading]] and links to documents with a & in the filename.

A bigger rewrite replaces a regex with a manual loop, so we can identify codeblocks and ignore anything that looks like a link inside them. (the clean solution would be building something like an AST, but that is out of scope for me right now)

I had this code live on my page for a while and have not noticed any issues or weird behaviour.

foxblock added 2 commits June 14, 2025 20:00
Text inside a codeblock that looked like a link "[[what|ever]]" was removed before
Replaced the regex used to identify links with a manual search and replace loop

Fixes oleeskild#317
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Link creation does not take code blocks into account
1 participant