Issue with Syntax Highlighting (NG) Add-on in Anki v25.02.6: No Theme Colors Applied Despite Configuration

I’m using Anki (Version 25.02.6, Python 3.9.18, Qt 6.6.2, PyQt 6.6.1) to prepare for Data Structures and Algorithms (DSA). I’m trying to enable proper syntax highlighting for code snippets in my cards.

Initially, I installed the add-on “Syntax Highlighting for Code” (ID: 1463041493), but later realized it’s outdated and only supports very old Anki versions (2.1.0 as of 2018-10-07).

Then I installed “Syntax Highlighting (NG)” (ID: 566351439), which supports newer Anki versions (2.1.49–23.10.1+, last updated on 2024-07-19). It partially works:

  • I enabled all options under Tools > Syntax Highlighting Options (all 4 checkboxes).
  • I edited the config as follows to use the Monokai theme:
{
    "hotkey": "Alt+s",
    "limitToLangs": [],
    "style": "monokai"
}

However, after saving this configuration, the code blocks just appear centered — there’s no syntax coloring or theme change visible. How can I get proper syntax highlighting (with colors) to work correctly using this add-on on my current Anki version?

1 Like

Syntax Highlighting (NG) is broken by the Anki25.04+ security update, this problem has already been fixed but the add-on has not yet been uploaded to AnkiWeb.

any workaround i can do for this ??

or if it works if i downgrade anki ??

1 Like

This add-on should be updated later by the author so you will have to wait a while. If you are in a hurry downgrading Anki to 25.02 will probably work. If you are a developer there is a Github pull request for this add-on so adding it manually will probably work.

1 Like