Topic on Extension talk:SyntaxHighlight

how do disable the "pages with syntax highlighting errors" tracking category?

7
Nicole Sharp (talkcontribs)

How can I disable the "pages with syntax highlighting errors" tracking category? Not sure why, but I am experiencing a bug where this tracking category displays for the Pygments language of mma, though admittedly I am using mma incorrectly for Maxima syntax instead of Wolfram Mathematica syntax.

e:limit((1+n^-1)^n,n,inf);
i:sqrt(-1);
pi:integrate((1+x^2)^-1,x,-inf,inf);

Nicole Sharp (talk) 06:14, 27 March 2021 (UTC)

PerfektesChaos (talkcontribs)

I am not aware that this category is triggered when invalid syntax is occurring in code.

The category is configured via MediaWiki:Syntaxhighlight-error-category system message.

  • I would not recommend to drop the entire category.
  • Usually they are sensitive for template programming.
  • Therefore you can evaluate by {{#switch: {{FULLPAGENAME}} |=}} the current page and whitelist some exceptional pages, by assigning - and category title respectively.

Anyway, you might mark the category as __HIDDENCAT__ which will show categorization to registered users only, who opt-in to see such hidden maintenance categorizations.

Tacsipacsi (talkcontribs)

I don’t think so—Flow doesn’t play nice with advanced wikitext features like categories—or syntax highlighting itself.

<!-- this should be highlighted as an HTML comment, yet it’s plain black -->
This doesn’t have any language at all, so if Flow worked properly, it ended up in the category.
Nicole Sharp (talkcontribs)

I didn't know you could hide categories. That seems to be an adequate solution to keep the category from public view. I am not sure why it is being triggered though since the extension is being used correctly and not meeting the criteria for syntax highlighting errors. It seems to be a problem with the server or wiki configuration since it is affecting all Pygments languages, not just mma. I am switching over to use Highlightjs_Integration instead though, since HighlightJS supports Maxima and Pygments does not. Nicole Sharp (talk) 14:22, 27 March 2021 (UTC)

Nicole Sharp (talkcontribs)

Unfortunately, the hidden categories aren't hidden very well, and still show up under "special:categories." Is there a way to disable the SyntaxHighlight tracking categories? Nicole Sharp (talk) 03:12, 28 March 2021 (UTC)

Nicole Sharp (talkcontribs)

Found an alternative solution. Since something in either the wiki or server configuration is causing every use of syntaxhighlight to be tracked with the category "pages with syntax highlighting errors," regardless of correct or incorrect use of SyntaxHighlight, I used MediaWiki:syntaxhighlight-error-category to change the name of the tracking category to "pages with syntax highlighting." Since there are no errors, at least the categorization is correct now. However, this doesn't solve the underlying problem in that the extension seems to be broken. In addition to thinking the syntax has errors, the highlighting itself doesn't display. Can't figure out why but seems better/easier to switch over to HighlightJS instead. Nicole Sharp (talk) 03:34, 28 March 2021 (UTC)

Nicole Sharp (talkcontribs)

Installing the Highlightjs_Integration extension (while keeping SyntaxHighlight enabled) removed the (incorrect) SyntaxHighlight tracking category, so the two extensions seem to work well together. Unless a custom element (such as "highlight" instead of "syntaxhighlight") is defined for Highlightjs_Integration, the default behavior is for Highlightjs_Integration to take priority for highlighting over SyntaxHighlight, which avoids conflicts (and any SyntaxHighlight errors for HighlightJS languages not available in Pygments). Nicole Sharp (talk) 04:23, 28 March 2021 (UTC)

Reply to "how do disable the "pages with syntax highlighting errors" tracking category?"