mw-markdown icon indicating copy to clipboard operation
mw-markdown copied to clipboard

<nowiki> not working with link syntax

Open joelittlejohn opened this issue 4 years ago • 1 comments

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:

  • [[File:File.jpg]] to use the full version of the file

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 avatar Oct 31 '19 22:10 joelittlejohn

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.

joelittlejohn avatar Oct 31 '19 23:10 joelittlejohn