Skip to content

Code unnecessarily wrapped in <table> when line numbers are disabled #15

Open
@agentydragon

Description

@agentydragon

Problem description

This is how the HTML from Syntax Highlighting addon looks:

<table><tbody><tr><td><div class="highlight"><pre><span class="o">&gt;&gt;&gt;</span> <span class="n">df</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span>
<span class="o">...</span>     <span class="n">data</span><span class="o">=</span><span class="p">{</span><span class="s1">'name'</span><span class="p">:</span> <span class="p">[</span><span class="s1">'Alice'</span><span class="p">,</span> {{c4::<span class="s1">'Bob'</span><span class="p">,</span> <span class="s1">'Charlie'</span>}}<span class="p">]},</span>
<span class="o">...</span>     <span class="n">{{c3::index}}</span><span class="o">=</span><span class="p">[</span><span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">])</span>
<span class="o">&gt;&gt;&gt;</span> <span class="k">print</span><span class="p">(</span><span class="n">df</span><span class="o">.</span><span class="n">{{c1::lo}}c</span><span class="p">[</span><span class="mi">1</span><span class="p">][</span><span class="s1">'name'</span><span class="p">],</span>
<span class="o">...</span>       <span class="n">df</span><span class="o">.</span><span class="n">{{c1::ilo}}c</span><span class="p">[</span><span class="mi">1</span><span class="p">][</span><span class="s1">'name'</span><span class="p">])</span>
<span class="n">{{c2::Charlie}}</span> <span class="n">{{c2::Bob}}</span></pre></div></td></tr></tbody></table>

The <table><tbody><tr><td> tags seem to me to be unnecessary. As far as I understand, they are there to support line numbers, but since I don't have line numbers enabled, I don't think they serve any purpose. (With my CSS, they just take up extra whitespace.)

I've set up syntax highlighting without line numbers, and style it with my own CSS.

Checklist

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

  • [ x ] I've restarted Anki to see if it helps
  • [ ] I've verified that I use the latest version of the add-on by redownloading it from AnkiWeb
  • [ ] I've verified that I use the latest version of Anki by checking at https://apps.ankiweb.net#download
  • [ ] I've tried to disable other add-ons to see if there are any interactions present
  • [ ] My issue disappears when I hold shift while starting Anki.
  • [ ] I've checked if anyone else reported this problem before by looking through the issue reports. I also checked to see if there is a section about known issues in the add-on description, documentation, or README.

Information about your Anki set-up

Please fill out the section corresponding with your Anki version:

I don't have "copy debug info" in my Anki, it's probably an older version:

Version 2.1.8 (71e0c880)
Qt 5.12.4 PyQt 5.12.3
  • OS: Ubuntu 19.10
Distributor ID:	Ubuntu
Description:	Ubuntu 19.10
Release:	19.10
Codename:	eoan

Please open Anki, go to Tools → Add-ons, take a screenshot of your installed add-ons, and paste it below:

image

Error message (if any)

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions