After many years of using DokuWiki… I still wonder how to implement the formatting in links. I have read in
this thread that is possible using the plugin. At the end of the day the plugin should basically call the code in function
handler.php:internallink($match, $state, $pos). The handler delegates calls to the renderer, which hopefully does not HTML-escape the link name. The problem is in re-using entry/exit patters defined in
class Doku_Parser_Mode_internallink,
class Doku_Parser_Mode_media,
class Doku_Parser_Mode_externallink – all that does not seem to be trivial.
In fact this functionality could be supported by DokuWiki the same way as formatting on footnotes (see
class Doku_Parser_Mode_footnote): instead of "addSpecialPattern()" mentioned classes should use "addEntryPattern()"/"addExitPattern()". The problem is that "DOKU_LEXER_ENTER" event should delegate rendering of "<a href=...>" in HTML to the renderer (which currently requires all information about the link and renders it completely), and "DOKU_LEXER_EXIT" event should simply render "</a>".
Currently I don't see a proper way of re-using all DokuWiki features (e.g. interwiki support) without modifying renderer interface.
Any suggestions are warmly welcomed.