• Resolved sofho

    (@sofho)


    Hi.

    Any tips on keeping the code/color syntax in the <pre> blocks when operating with a custom theme? It looks like there is some extra script running on the “ChatGPT” and “Messages (iOS)” themes that add extra classes and thereby the syntax-coloring.

    I’ve imported the “_codeLight.scss” from the plugin theme, but it only works partially, as no extra classes are created.

    Is it possible to still invoke til script on a custom theme?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter sofho

    (@sofho)

    Ah. It looks like highlight.js has issues on my custom theme. I’m getting some “Could not find class for hljs-title”-errors (along with similar errors for “keyword” and “string”) in the console.

    Still investigating.

    Plugin Support Val Meow

    (@valwa)

    Hey @sofho !

    You can go to AI Engine settings and turn on “Syntax Highlight”. It will automatically add the class to the text in the pre element. 👌

    Thread Starter sofho

    (@sofho)

    Thank you for the quick reply.

    Syntax-hightlightning is already on – and it works when using the default themes “ChatGPT” and “Messages (iOS)”. It also partially works for my custom theme, as a few words are getting highligted (in my case the “document”-word of a javascript example).

    But the default plugins seem to have extra classes added through javasript, most likely via the highlight-script, that I’m not getting on a custom theme.

    In the console i get a set of errors (see my comment above), which seems to confirm that there is an issue classes.

    It looks like the “no theme” option is missing a class for the highlight-syntax to run correcly, but I’m having a hard time determining what this class is and how I should add it through my custom theme.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Keep syntax-coloring on code-examples (with no theme)’ is closed to new replies.