File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1616from docutils .parsers .rst .states import Inliner
1717
1818from sphinx .application import Sphinx
19+ from sphinx .builders import Builder
1920from sphinx .builders .html import StandaloneHTMLBuilder
2021from sphinx .builders .latex import LaTeXBuilder
2122
2223from . import meta
2324
2425
26+ # List of all builders that support render :class:`strike_node`.
27+ SUPPORTED_BUILDERS : list [type [Builder ]] = [StandaloneHTMLBuilder , LaTeXBuilder ]
28+
2529class strike_node (nodes .Inline , nodes .TextElement ):
2630 pass
2731
@@ -37,7 +41,7 @@ def strike_role(
3741) -> Tuple [List [Node ], List [system_message ]]:
3842 env = inliner .document .settings .env # type: ignore
3943
40- if not isinstance (env .app .builder , ( StandaloneHTMLBuilder , LaTeXBuilder )):
44+ if not isinstance (env .app .builder , tuple ( SUPPORTED_BUILDERS )):
4145 # Builder is not supported, fallback to text.
4246 return [Text (unescape (text ))], []
4347
You can’t perform that action at this time.
0 commit comments