sphinx-copybutton icon indicating copy to clipboard operation
sphinx-copybutton copied to clipboard

ID of the `div.highlight pre` element gets overwritten

Open So-Cool opened this issue 4 years ago • 1 comments

Describe the bug

The extension overwrites the id of the div.highlight pre element with codecell# (if it already has one). The expected behaviour would be to use the id that already exists.

To Reproduce

  1. Create a code block with an id, e.g.:
    <div class="highlight">
        <pre id="my-id">
            code...
        </pre>
    </div>
    
  2. Open the HTML page.
  3. my-id is overwritten with codecell0.

Expected behavior

my-id is preserved and used to facilitate the extension functionality.

Environment

  • Python Version [e.g. 3.7.1]: 3.8.2
  • Package versions or output of jupyter-book --version: 0.3.1
  • Operating System: MacOS 10.15.6

Additional context

Jupyter Book: 0.9.1
MyST-NB: 0.10.1
Sphinx Book Theme: 0.0.39
MyST-Parser: 0.12.10
Jupyter-Cache: 0.4.1
NbClient: 0.5.1

So-Cool avatar Jan 02 '21 01:01 So-Cool

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar Jan 02 '21 01:01 welcome[bot]