glutanimate / syntax-highlighting

A fork of Tiago Barroso's Syntax Highlighting add-on with support for Anki 2.1
https://ankiweb.net/shared/info/1463041493
Other
108 stars 27 forks source link

Night mode can't copy/paste code highlights #34

Open jacobcassidy opened 3 years ago

jacobcassidy commented 3 years ago

Problem description

Syntax highlighting work as expected in normal (light) mode. For example, copying JavaScript code from VSCode and pasting it into an Anki card...

Adding in light mode

But when using night mode, pasting the same code into an Anki card no longer shows syntax highlighting. Instead, it shows as plain text...

Adding in night mode

As soon as I uncheck night mode and restart Anki in normal mode, I can paste the same code to get the expected syntax highlighting again.

Interestingly, code added in normal (light) mode will show syntax highlighting correctly when I switch to night mode. I just can't add new cards with the correct syntax highlighting in night mode. See the following comparisons:

added in light mode - display in night mode

added in night mode - display in night mode

Checklist

Please replace the space inside the brackets with an x if the following items apply:

If you are using Anki 2.1

    Anki 2.1.44 (b2b3275f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
    Platform: Mac 10.15.7
    Flags: frz=True ao=False sv=2
    Add-ons, last update check: 2021-06-02 11:20:33

    ===Add-ons (active)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    Syntax Highlighting for Code ['1463041493', 2018-10-07T08:31, 'None', '']

    ===IDs of active AnkiWeb add-ons===
    1463041493

    ===Add-ons (inactive)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])