mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Make code role highlighting consistent with code-block directive
Fixes https://github.com/sphinx-doc/sphinx/issues/5157
This is factored out of the sphinx-immaterial theme:
1ef121a612/sphinx_immaterial/inlinesyntaxhighlight.py (L1)
See also:
https://github.com/sphinx-doc/sphinx/pull/6916
This commit is contained in:
0
tests/roots/test-reST-code-role/conf.py
Normal file
0
tests/roots/test-reST-code-role/conf.py
Normal file
9
tests/roots/test-reST-code-role/index.rst
Normal file
9
tests/roots/test-reST-code-role/index.rst
Normal file
@@ -0,0 +1,9 @@
|
||||
.. role:: python(code)
|
||||
:language: python
|
||||
:class: highlight
|
||||
|
||||
Inline :python:`def foo(1 + 2 + None + "abc"): pass` code block
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def foo(1 + 2 + None + "abc"): pass
|
||||
Reference in New Issue
Block a user