Describe the bug
When using the code directive instead of code-block, the :emphasize-lines: option produces an error:
/tmp/sphinxbug/index.rst:1: ERROR: Error in "code" directive:
unknown option: "emphasize-lines".
.. code:: rst
:emphasize-lines: 1
test [docutils]
sourcecode directives work.
How to Reproduce
Just use this as your index.rst and try to build the docs:
.. code:: rst
:emphasize-lines: 1
test
Adding -block after code fix the issue.
Environment Information
Platform: linux; (Linux-6.18.15-1.qubes.fc41.x86_64-x86_64-with-glibc2.36)
Python version: 3.14.4 (main, Apr 14 2026, 14:26:14) [Clang 22.1.3 ])
Python implementation: CPython
Sphinx version: 9.1.0
Docutils version: 0.22.4
Jinja2 version: 3.1.6
Pygments version: 2.20.0
Sphinx extensions
Additional context
No response
Describe the bug
When using the
codedirective instead ofcode-block, the:emphasize-lines:option produces an error:sourcecodedirectives work.How to Reproduce
Just use this as your index.rst and try to build the docs:
Adding
-blockaftercodefix the issue.Environment Information
Sphinx extensions
Additional context
No response