Extension talk:Highlightjs Integration

About this board

Extension won't highlight Lua

1
Sydchako (talkcontribs)

Is there any way to highlight lua code with this extension? All other languages are working.

Reply to "Extension won't highlight Lua"

how to change tab-size

1
Nicolas senechal (talkcontribs)

Hello,

I try to change tab-size how I can do that?

I try to change in some css with add tab-size : 4 in the part .hljs but don't work.

thank you.

Reply to "how to change tab-size"
Nicolas senechal (talkcontribs)

Hello,

I try to get it for the vb language, so I try to follow this part so I get vb.net and I replace highlight old folders and change the extension.json thing (like in the this).

I use a black theme so it's easy to know when it's working...

But he didn’t work if I just put <syntaxhighlight lang=""> I don't have any colour (but I have my black theme), so maybe I miss something because for C# it works with the lang specific and without.

Maybe because I get itowd from Getting highlight.js (highlightjs.org) in version 11.4.

Any help is appreciated.

NikusPokus (talkcontribs)

Hello, Does it work if you specify the language? If yes, it seems to be the detection of the language which can't find out which language it is from the code you want to highlight. So test with a bigger code to highlight. If it still doesn't work, there is a problem with the language detection and you have force it. Other question: was it working without upgrading highlight.js?

Nicolas senechal (talkcontribs)

Thank you and sorry for your time, I resolved it.

So the detection of language worked but not for vb.

To resolve this I simply follow carefully this part and then it worked.

I can't remember my error so thank you again for taking your time !

Reply to "Error vb language"
Nicole Sharp (talkcontribs)
Nicole Sharp (talkcontribs)
Buovjaga (talkcontribs)

There is an extension that uses Prism.js and it supports line numbers. I am not allowed to add the link here, but search for SyntaxHighlight_PrismJS on GitHub

Reply to "line numbers"

Will CSS be highlighted?

3
Wgkderdicke (talkcontribs)

Here in this wiki the SyntaxHighlight extension is at work. Usually one uses the <syntaxhighlight> tag to mark those parts which shall be highlighted. Pages like MediaWiki:Gadget-site.css are highlighted. But there I find no <syntaxhighlight> tag in the wiki code. Will this extension hightlight such css pages without the tag as well?

Nicole Sharp (talkcontribs)

No. This extension only affects code contained within HTML/XML elements (tags) such as syntaxhighlight. To highlight without tags requires changing the content model of the page, such as with the SyntaxHighlightPages Extension. You can use both SyntaxHighlightPages and Highlightjs_Integration at the same time, but they use different highlighting libraries and styles (Pygments vs. HighlightJS). Nicole Sharp (talk) 13:51, 27 March 2021 (UTC)

Nicole Sharp (talkcontribs)

I would really like to see the HighlightJS library and style options applied to page content models though like with SyntaxHighlightPages. Nicole Sharp (talk) 14:08, 27 March 2021 (UTC)

Reply to "Will CSS be highlighted?"

Extension not working in VisualEditor

3
RockSheep (talkcontribs)

When I try to edit a page using VisualEditor, not is shown in the code lines. Is there a way to make it work in VisualEditor like SyntaxHighlight_GeSHi does?

I'm using version 1.2 in xampp with MediaWiki 1.31.1, PHP 7.0.33.

Nicole Sharp (talkcontribs)

I also cannot preview the syntax highlighting using HighlightJS Integration 1.1 for MediaWiki 1.35.1 LTS (with PHP 7.4.15). A small inconvenience though for the additional language support compared to using Pygments SyntaxHighlight. Nicole Sharp (talk) 14:02, 27 March 2021 (UTC)

Nicole Sharp (talkcontribs)

Where did you get version 1.2? The most recent version available on GitHub is 1.1. Nicole Sharp (talk) 14:04, 27 March 2021 (UTC)

Reply to "Extension not working in VisualEditor"
Scott216 (talkcontribs)

I installed this extension (v1.2). I'm running MediaWiki v1.32 on a shared linux computer (SiteGround), PHP 7.0.33. The code highlighting works, but the background is black instead of light gray.

Scott216 (talkcontribs)

I fixed it by changing the style to vs.css in extension.json. I assumed the default look would be similar to what is shown in the description.

Nicole Sharp (talkcontribs)

Yes, using default.min.css (for HighlightJS 10) fits in better with the MediaWiki Vector default style, but the dark background from railcasts.min.css is admittedly a bit easier to read. Haven't decided on a favorite HighlightJS style yet but you can browse through the style options on the HighlightJS demo site. Nicole Sharp (talk) 13:58, 27 March 2021 (UTC)

Reply to "Background is black"
Nicole Sharp (talkcontribs)

I can't get maxima recognized for syntax highlighting. Any suggestions? I already upgraded to HighlightJS 10.7.1, though Maxima has been available for HighlightJS since 9.2.0. Maxima highlighting is not available at all with Pygments SyntaxHighlight so would really like to see this working if possible. Nicole Sharp (talk) 11:27, 27 March 2021 (UTC)

Nicole Sharp (talkcontribs)

I got it working. Add "highlight/languages/maxima.min.js", to extension.json as below.

            "scripts": [
                "highlight/highlight.min.js",
                "highlight/languages/maxima.min.js",
                "init.js"
            ],

Nicole Sharp (talk) 11:40, 27 March 2021 (UTC)

Reply to "Maxima"
Nicole Sharp (talkcontribs)

It would be good if there was a way to load HighlightJS from a CDN hyperlink instead of needing a local copy installed. SimpleMathJax has this ability. Nicole Sharp (talk) 09:56, 27 March 2021 (UTC)

Reply to "CDN link"

No highlighting in MW 1.34.2

1
Steipe (talkcontribs)

Tagged text appears as either <pre>...</pre> or <code>...</code> with an extension-specific class (e.g.) <code class="code2highlight lang-php" style="display: inline;">...</code> ... this is rendered in a fixed-width font with a grey background - but no actual syntax highlighting is applied.

Reply to "No highlighting in MW 1.34.2"