I'm working on a wiki program that uses Markdown for it's content. I've been using flexmark (thank you so much) to handle the Markdown and passing that on to MathJax to handle rendering mathematics.
I also use Mediawiki style wikilinks, "[[link-part|optional-display-part]]", for internal links to other pages in the wiki. Up to now, I've resolved the wikilinks with a regular expression search and pasting the link back into the document along with appropriate styling -- red text for links to pages that don't exist and disabled links that the user is not allowed to follow because of their role, e.g. a "normal" user cannot follow links that would let them delete another user account.
This has worked fine except that wikilinks inside code blocks get translated anyway. Makes writing some documentation problematic. I thought the wikilinks extension would be a better way to handle this if there is a way to change rendering of links based on user authorization. But I can't figure out if there is already something like that capability (just adding a class in the HTML), or if cloning the extension would be the right thing to do, or if something else would be better.
Any advice?
- solved #7
- replies 8
- views 8.7K
- likes 0