Topic on Extension talk:SyntaxHighlight

How to write </syntaxhighlight> inside <syntaxhighlight></syntaxhighlight>?

3
Summary by Tacsipacsi

Using {{#tag:}} and some extra hack.

2A01:E0A:AE5:F900:225:22FF:FE67:EEA2 (talkcontribs)

Is it possible to write </syntaxhighlight> inside a syntaxhighlight without being interpreted as the end of it ? I mean, it's possible, since the presentation page did it… But reading the source code didn't give me a clue about how to do it!

Tacsipacsi (talkcontribs)

You have to use {{#tag:syntaxhighlight|...}} for the actual highlighting, putting the code to be highlighted in place of the .... However, if you’d just put <syntaxhighlight></syntaxhighlight> there, MediaWiki tried to interpret that as well, resulting in something like '"`UNIQ--syntaxhighlight-00000001-QINU`"' being the content. You have to stop MediaWiki somehow from interpreting the content, which can be done in several ways. This page replaces the leading < sign with a call to the template {{^(}}, but if you don’t want to create a such template on your wiki, putting a <nowiki /> somewhere in the middle of the opening tag (e.g. <syntax<nowiki />highlight>) should also work.

2A01:E0A:AE5:F900:225:22FF:FE67:EEA2 (talkcontribs)

It looks like the "nowiki" tag can't be used simultaneously with the #tag thing on my MediaWiki without the #tag thing bugging. But I'll do with the template thing.


Thank you