lychee icon indicating copy to clipboard operation
lychee copied to clipboard

Improve wikilink parsing and checking

Open JayJayArr opened this issue 4 months ago • 6 comments

  • [x] Extract the correct filename from a Wikilink by removing potholes and fragments
  • [x] Create a new Checker for wikilinks, make it clear to the users that a base-url is required
    • [x] Check Obsidian style wikilinks without headers
    • [x] strip fragments & potholes from wikilinks
    • [x] traverse the wiki-directory and check if any of the Filenames exist with any of the specified --fallback-extensions

JayJayArr avatar Aug 14 '25 12:08 JayJayArr

@jrfnl I am having trouble understanding the MediaWiki links with () and :. Are there really markdown files named Help:Links or where do they point to? Is [[Extension:DynamicPageList (Wikimedia)]] different to [[Extension:DynamicPageList]]

Could you please clarify this?

JayJayArr avatar Aug 21 '25 06:08 JayJayArr

Guess you can rebase on top of master now to fix CI.

mre avatar Sep 30 '25 13:09 mre

@JayJayArr, any chance you could fix the merge conflicts? I would love to get this great work merged. 😊

mre avatar Nov 12 '25 00:11 mre

There we go. Lets call it okay for now :sweat_smile:

JayJayArr avatar Nov 13 '25 21:11 JayJayArr

Apparently archive.org has some problems right now which breaks CI

JayJayArr avatar Nov 20 '25 23:11 JayJayArr

Sorry, I've added a few more comments. But we're getting super close to finishing this work now. Hang in there. 🤩

mre avatar Nov 25 '25 14:11 mre

Thanks for taking a look at the error handling here @thomas-zahner ! Added some more testcases for valid and invalid WikiLinks, if you still have any specific testcase in mind that we should check here please let me know. Added a check for unsupported characters as well :sweat_smile:

JayJayArr avatar Dec 22 '25 16:12 JayJayArr

Added a Test from the cli and a Unit Test for the WikilinkResolver for this case. You did not miss it, it was indeed missing, sorry for the gap there!

JayJayArr avatar Dec 23 '25 15:12 JayJayArr

@JayJayArr Thank you very much for the changes and the work, this really is a great addition. I've just removed a dbg! expression you probably forgot to remove and simplified indexing with 0c3dcb53295fbc255d7511d78724e055437de2b8.

thomas-zahner avatar Dec 23 '25 20:12 thomas-zahner

@JayJayArr and everyone who reviewed and contributed to the discussion: thank you for working on this! I look forward to seeing this in the next release. 💞

jrfnl avatar Dec 23 '25 21:12 jrfnl

Thanks to both of you @mre & @thomas-zahner for your support on this!

JayJayArr avatar Dec 24 '25 10:12 JayJayArr