You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
code-block directives use short pygments class names. Inline code snippets (the code role), on the other hand, use long Pygments class names. As a result, inline code snippets are not properly highlighted.
To Reproduce
$ mkdir /tmp/sphinx
$ cd /tmp/sphinx
$ sphinx-quickstart
…
$ # edit index.rst as shown below
$ tail index.rst
* :ref:`search`
.. role:: bash(code)
:language: bash
Test inline: :bash:`export FOO="bar"`.
.. code-block:: bash
export FOO="bar"
$ make html
Makefile:20: warning: undefined variable 'O'
…
The HTML pages are in _build/html.
$ firefox _build/html/index.html
Expected behavior
Both code snippets should be highlighted. Insetad, only the code block is highlighted. The inlien snippet has pygments classes applied, but they use long class names, and so they don't match the syntax-highlighting CSS rules, which use short class names.
Environment info
OS: GNU/Linux (Linux Mint 20)
Python version: Python 3.8.2
Sphinx version: sphinx-build 3.0.4
Sphinx extensions: None
Extra tools: Firefox
The text was updated successfully, but these errors were encountered:
Describe the bug
This error was originally reported on https://stackoverflow.com/questions/21591107/sphinx-inline-code-highlight
code-block
directives use short pygments class names. Inline code snippets (thecode
role), on the other hand, use long Pygments class names. As a result, inline code snippets are not properly highlighted.To Reproduce
Expected behavior
Both code snippets should be highlighted. Insetad, only the code block is highlighted. The inlien snippet has pygments classes applied, but they use long class names, and so they don't match the syntax-highlighting CSS rules, which use short class names.
Environment info
The text was updated successfully, but these errors were encountered: