When line numbers are active, the code block is turned into a table with one row and two cells. The first cell contains the line number and the second cell contains the code. Highlights are done via the HTML tag. When a line with line number is highlighted two tags are created: one around the line number(s) and one around the code.
As you can see from the examples below, the styling does not look great for a code block. Would it be possible so that code blocks to not have this styling applied to them? I noticed that when you have a code block, regardless of whether it has line numbers enabled or not, it is wrapped in <pre> and <code> tags. Not sure if this is helpful but it is different than tables which are not nested in other tags.
Without linenos
```python
try:
from jupyter_client.kernelspec import install_kernel_spec
except ImportError:
from IPython.kernel.kernelspec import install_kernel_spec
from IPython.utils.tempdir import TemporaryDirectory
![image](https://user-images.githubusercontent.com/7043297/173472395-b51be546-b9c3-4aad-8f43-3272a0ddbcae.png)
With `linenos`
try:
from jupyter_client.kernelspec import install_kernel_spec
except ImportError:
from IPython.kernel.kernelspec import install_kernel_spec
from IPython.utils.tempdir import TemporaryDirectory
Inserting a code block with
linenos
turns it into a table.From the zola documentation on Syntax Highlighting:
As you can see from the examples below, the styling does not look great for a code block. Would it be possible so that code blocks to not have this styling applied to them? I noticed that when you have a code block, regardless of whether it has line numbers enabled or not, it is wrapped in
<pre>
and<code>
tags. Not sure if this is helpful but it is different than tables which are not nested in other tags.Without
linenos