Conflict if other plugins introduce a special URL syntax
Closed this issue · 2 comments
The problem occured because using the externallink plugin. This plugin introduces a replacement for links like this one: [[@/somewhere/something]] - '@' will be replaced by the URL root of the server where DokuWiki is runnig. This makes it easy to link pages on same server, but outside DokuWiki. So far I might use the interwiki mechanism as well. But for me the URL root may change, dependent from where (intranet, internet) I come. And then the alternative URL is invalid. The externallink plugin solves that problem.
Now the issue - without change the orphanswanted plugin lists all links [[@/... as wanted.
Pragmatically after line 114 in helper.php I added this line:
and ! preg_match('/^@/{1}.*$/u',$link) // conc. plugin externallink jg(2013/02/28)
But I am unsure if that isn't a too pragmatic change. Thatswhy I didn't branch yet and wanted to discuss it here.
Maybe a config option for additional regular expressions should be added. Or better an option which allows to name plugins which should be used for pre-parsing before analyzing the links? The latter, if possible at all, probably would be significantly slower.
Best regards,
Joern.
Actually there are much better options for finding all links as DokuWiki has an index of all (internal) links (regardless if the target pages exist or not) that is also used for the backlinks. The plugin could simply read the index and do some checks if the target/source pages (don't) exist/(don't) have links without parsing any page.
Fixed in release 2023-05-30 by using the internal index.