Category talk:Pages with syntax highlighting errors

Latest comment: 7 years ago by SoledadKabocha in topic User scripts

Unsupported languages edit

At this writing, the following languages used in Wikipedia articles appear to be unsupported by Pygments:

  • algol68
  • e
  • freebasic
  • oberon2
  • pli
  • Unicon

Any others? – Jonesey95 (talk) 20:48, 4 September 2016 (UTC)Reply

Yes, "text" for starters. If you figure out out to get that supported, please show us how you did it. Thanks, wbm1058 (talk) 10:34, 14 September 2016 (UTC)Reply
See mw:Extension:SyntaxHighlight#Supported languages, and [expand] the Previously supported lexers box. The documentation seems to erroneously think that text (Plain text) is still supported. – wbm1058 (talk) 10:58, 14 September 2016 (UTC)Reply
Never mind. text seems to work, as long as the code fragment isn't larger than 100 kB. See § Syntax highlighting errors. – wbm1058 (talk) 12:15, 14 September 2016 (UTC)Reply

What is wrong with friendly interactive shell? edit

In friendly interactive shell, I find lang=fish, console, and bash, all of which are on the supported language list. What am I missing? – Jonesey95 (talk) 20:52, 4 September 2016 (UTC)Reply

It had a couple of <source> tags that didn't specify a language. This edit fixed it. – wbm1058 (talk) 11:45, 14 September 2016 (UTC)Reply

Syntax highlighting errors edit

Do you have any idea why User:Magioladitis/WikiProjects is in Category:Pages with syntax highlighting errors? I'm trying to clear that category, not that I know what I'm doing. I've fixed several of them by replacing the <source> tags with <pre> (preformatted text) tags, such as here. – wbm1058 (talk) 20:04, 4 September 2016 (UTC)Reply

(talk page stalker) @Wbm1058: Wrong fix - try this. --Redrose64 (talk) 20:26, 4 September 2016 (UTC)Reply
Redrose64, what is moin and what difference does it make? Cosmetically, the page appears the same. wbm1058 (talk) 20:31, 4 September 2016 (UTC)Reply
See User talk:Cedar101#languages for source. One reason to avoid <pre>...</pre> is that in some circumstances, its contents can still be parsed as wikitext. <source>...</source> - which is essentially synonymous with <syntaxhighlight>...</syntaxhighlight> - prevents such parsing. --Redrose64 (talk) 20:41, 4 September 2016 (UTC)Reply
It just seems silly to claim that the code is in something obscure like MoinMoin... the code is in MediaWiki !! And if we should avoid <pre>...</pre> and use <source>...</source> or <syntaxhighlight>...</syntaxhighlight>, then the latter two shouldn't dump every page that uses those into Category:Pages with syntax highlighting errors! Sorry if I seem annoyed (I am), but it's a joke that our documentation of this – Wikipedia:Syntax highlighting – is a disambiguation page. {{dabconcept}}! – wbm1058 (talk) 21:27, 4 September 2016 (UTC)Reply
Cedar101, you have plenty of experience of this, what do you suggest? --Redrose64 (talk) 22:03, 4 September 2016 (UTC)Reply
See bug ticket T29828. – Jonesey95 (talk) 00:25, 5 September 2016 (UTC)Reply
Back to the OP's question, I haven't figured out a fix for the User page in question. I tried lang="c#", which appears to be a supported language, but the category persists. – Jonesey95 (talk) 21:03, 4 September 2016 (UTC)Reply
csharp should be supported, it's listed at mediawiki-extensions-SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.lexers.php --Redrose64 (talk) 21:58, 4 September 2016 (UTC)Reply

Maybe the text is too long? -- Magioladitis (talk) 22:00, 4 September 2016 (UTC)Reply

I think there are size limitations. -- Magioladitis (talk) 22:17, 4 September 2016 (UTC)Reply

That makes sense, as I found a couple other long pages with syntax highlight errors, such as User:BattyBot/CS1 errors-dates. Is this a bug in Pygments? Is there a workaround? If syntax highlighting doesn't work for long pages, then there seems to be no benefit to using <source>...</source> or <syntaxhighlight>...</syntaxhighlight>, and we may as well just replace them with <pre>...</pre> to clear the category so people don't go chasing down spurious errors. wbm1058 (talk) 22:41, 4 September 2016 (UTC)Reply
"Highlighting large blocks of code can easily generate enough of them to crash a browser. As a guard, syntax highlighting is turned off for code fragments larger than 100 kB." Can we guess that such code fragments also put the article in the maintenance category? It would be nice to find confirmation of that. – Jonesey95 (talk) 00:27, 5 September 2016 (UTC)Reply

Initial effort to clear this category edit

On Sept. 4, 2016 I started working to clear this category, whereupon I reported the issues discussed above. Anyone is welcome to review my edits, the relevant edit history is here. wbm1058 (talk) 12:53, 14 September 2016 (UTC)Reply

User scripts edit

One cause that occasionally comes up (which I encountered myself a little over a year ago) is that a user script contains a string constant like '<syntaxhighlight'. This didn't seem to be a problem with GeSHi for some reason. The solution is usually to split the string constant into '<syntaxh' + 'ighlight' or similar.

Should we amend the description of the category to clarify that this is an issue? Should we warn affected users? --SoledadKabocha (talk) 18:53, 26 November 2016 (UTC)Reply

On second thought, never mind. A quick look through the category shows that extant cases in JavaScript files include MediaWiki:LAPI.js, User:Cacycle/wikEd.js (and a couple forked copies), and MediaWiki:Robots.txt. None of these match the exact problem I described; all may be due to the aforementioned length limit. --SoledadKabocha (talk) 22:28, 19 December 2016 (UTC)Reply