Topic on Extension talk:SyntaxHighlight

Polymath uk (talkcontribs)

I have a brand new, uncustomised install:

MediaWiki 1.39.1
PHP 7.4.33 (apache2handler)
MariaDB 10.5.18-MariaDB-0+deb11u1
ICU 67.1
Lua 5.1.5
Pygments 2.11.2

I cannot get line numbers to work with sytaxhighligh (as invoked through wfLoadExtension( 'SyntaxHighlight_GeSHi' ); in LocalSettings.php.

It otherwise behaves perfectly. Any ideas?

Peculiar Investor (talkcontribs)

Any chance you are running the wiki on a shared hosting plan? If so, check that python3 is installed and can be called by pygmentize.

Polymath uk (talkcontribs)

There's no chance of that because I'm hosting it myself.

However..... I am experimenting with containers (LXC) and I have read somewhere that it is possible that something in /proc cannot be properly accessed by systems in containers, and this affects the rendering. I think its likely this is the problem for me. Oddly, line numbers appear in the visual editor code window, they just disappear when the edit is committed.

Jdforrester (WMF) (talkcontribs)

That's because the line numbers inside the editor are provided by different software (the editor, which runs in client-side JS, instead of the SyntaxHighlight extension's server-side call out to Pygments).

Want (talkcontribs)

Could you indicate here how your syntax of syntaxhighlight element looks like, please? Thank you.

Polymath uk (talkcontribs)

This is a typical example:

<syntaxhighlight lang="php" line>

$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'doc', 'xls', 'mpp', 'pdf', 'ppt', 'tiff', 'bmp', 'docx', 'xlsx', 'pptx', 'ps', 'odt', 'ods', 'odp', 'odg');

</syntaxhighlight>

Want (talkcontribs)
Reply to "No line numbers"