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

Line numbers misaligned only on AnkiDroid #27

Closed smartlitchi closed 3 years ago

smartlitchi commented 3 years ago

Problem description

I am using Dark Mode on both Anki and AnkiDroid so I checked Use CSS Class and copied the default CSS style from the documentation. Everything renders perfectly on Anki but line numbers are misaligned when I review my cards on AnkiDroid. I'll leave screenshots below.

On Anki :

screenshot-anki

And on AnkiDroid :

screenshot-ankidroid

Here is the HTML of the field :

<center><table class="highlighttable"><tbody><tr><td class="linenos"><div class="linenodiv"><pre>1
2</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">x</span> <span class="o">=</span> <span class="s1">'My 2 favorites numbers are 19 and 42'</span> 
<span class="nb">print</span><span class="p">(</span><span class="n">re</span><span class="o">.</span><span class="n">findall</span><span class="p">(</span><span class="s1">'[0-9]+'</span><span class="p">,</span><span class="n">x</span><span class="p">))</span>
</pre></div>
</td></tr></tbody></table></center>

Checklist

Information about your Anki set-up

    Anki 2.1.26 (arch-linux-2.1.26-1) Python 3.8.6 Qt 5.15.1 PyQt 5.15.1
    Platform: Linux
    Flags: frz=False ao=True sv=1
    Add-ons, last update check: 2020-10-21 23:53:32

    ===Add-ons (active)===
    (add-on provided name [Add-on folder, installed at, version, is config changed])
    '' ['ankisyncd', 0, 'None', '']
    CrowdAnki JSON exportimport Edit history Collaborate on deck creation ['1788670778', 2020-07-06T01:26, 'None', '']
    Hierarchical Tags 2 ['594329229', 2020-04-15T08:37, 'None', '']
    ImageResizer ['1214357311', 2020-04-10T15:29, 'None', '']
    Review Heatmap ['review_heatmap', 2020-04-30T15:23, 'None', '']
    Syntax Highlighting for Code ['1463041493', 2018-10-07T03:31, 'None', mod]

    ===IDs of active AnkiWeb add-ons===
    1214357311 1463041493 1788670778 594329229

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

It was fixed after a full download of the deck on AnkiDroid