Menu

#476 Using short pygments class names with HTML5 writer results in strings being struck-out

closed-fixed
nobody
None
5
2024-04-09
2023-11-07
No

When converting a reStructuredText document to HTML5 with the --syntax-highlight=short option, if any tokens in the highlighted code use the s class (for generic strings), docutils will render those tokens by wrapping them in <s>...</s>, producing struck-through text.

For example, given the following rST file:

.. code:: shell

    cat <<EOF
    Hello World!
    EOF

Running docutils --syntax-highlight=short on this file produces an HTML file containing the following:

<pre class="code shell literal-block"><code>cat<span class="w"> </span><s>&lt;&lt;EOT
Hello World!
EOT</s></code></pre>

Note the <s>...</s> around the heredoc, which is rendered as struck-through text.

Discussion

  • Günter Milde

    Günter Milde - 2023-11-10
    • status: open --> open-fixed
     
  • Günter Milde

    Günter Milde - 2023-11-10

    Thank you for the bug report and MWE.
    It is fixed in [r9471].

     

    Related

    Commit: [r9471]

  • Günter Milde

    Günter Milde - 2024-04-09
    • Status: open-fixed --> closed-fixed
     

Log in to post a comment.