Page MenuHomePhabricator

Provide a way of running language converter on syntaxhighlight-tagged code samples
Closed, DuplicatePublic

Description

A common hack for forcing LanguageConverter into converting "codelike" tags like <pre> and <code> is to include an empty conversion markup unit (-{}-) somewhere in the tag, usually in its very beginning. This feature (loophole?) is useful for code samples in Wikipedia articles, as commentary in the form of comments are best presented in the reader's native tongue script.

Commonly used as the more readable alternative to <pre> for presenting code samples, <syntaxhighlight> and <source> should provide a way (preferably less hacky) to enable the language converter. Since the highlighter is able to mark comments in the form of CSS classes, it may be a good idea to let LanguageConverter somehow include comments by default, too.

(Well, I tried smuggling a -{}- comment into a Python code sample, and it didn't work. I figured that reporting it here for an explicitly-defined feature may be a good idea...)