|
9 | 9 | from docutils.parsers.rst import directives |
10 | 10 | from docutils.parsers.rst.directives import images, tables |
11 | 11 | from docutils.parsers.rst.directives.misc import Meta |
12 | | -from docutils.parsers.rst.roles import set_classes |
13 | 12 |
|
14 | 13 | from sphinx.directives import optional_int |
15 | 14 | from sphinx.locale import __ |
16 | 15 | from sphinx.util import logging |
17 | | -from sphinx.util.docutils import SphinxDirective |
| 16 | +from sphinx.util.docutils import SphinxDirective, _normalize_options |
18 | 17 | from sphinx.util.nodes import set_source_info |
19 | 18 | from sphinx.util.osutil import SEP, relpath |
20 | 19 |
|
@@ -100,7 +99,7 @@ class Code(SphinxDirective): |
100 | 99 | def run(self) -> list[Node]: |
101 | 100 | self.assert_has_content() |
102 | 101 |
|
103 | | - set_classes(self.options) |
| 102 | + self.options = _normalize_options(self.options) |
104 | 103 | code = '\n'.join(self.content) |
105 | 104 | node = nodes.literal_block( |
106 | 105 | code, |
@@ -215,7 +214,7 @@ class Rubric(SphinxDirective): |
215 | 214 | } |
216 | 215 |
|
217 | 216 | def run(self) -> list[nodes.rubric | nodes.system_message]: |
218 | | - set_classes(self.options) |
| 217 | + self.options = _normalize_options(self.options) |
219 | 218 | rubric_text = self.arguments[0] |
220 | 219 | textnodes, messages = self.parse_inline(rubric_text, lineno=self.lineno) |
221 | 220 | if 'heading-level' in self.options: |
|
0 commit comments