bharley / mw-markdown

MediaWiki Markdown extension
MIT License
51 stars 20 forks source link

<nowiki> not working with link syntax #14

Open joelittlejohn opened 5 years ago

joelittlejohn commented 5 years ago

The <nowiki> tag doesn't quite function correctly with this extension active, in particular when used with the mediawiki links syntax.

An example of the problem is shown on the Special:Upload page. Instead of seeing the correct markup help, I see this:

image

When we should be seeing:

etc

This seems to be because Markdown.php calls $parser->replaceInternalLinks($html) without any attempt to escape things that are inside a <nowiki> tag.

Ideally I'd like to escape <nowiki> content before processing these links, but I can't find any simple function to call in the parser to make this happen :disappointed:

I'd love to help fix this up if anyone has any ideas about where to start.

joelittlejohn commented 5 years ago

For Special:Upload I worked around this by adding {{WIKI}} to the start of the page. I then also had to create an empty Template:WIKI to avoid the red text "Template:Wiki" being shown in my page.