Skip to content
This repository was archived by the owner on Apr 9, 2025. It is now read-only.

Commit 1d238d4

Browse files
committed
Do not override Translators if the builder is non-html
1 parent 3dd5eaf commit 1d238d4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

hoverxref/extension.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,12 @@ def setup_translators(app):
147147
and our own ``HoverXRefHTMLTranslatorMixin`` that includes the logic to
148148
``_hoverxref`` attributes.
149149
"""
150-
for name, klass in app.registry.translators.items():
151-
if app.builder.format != 'html':
152-
# Skip translators that are not HTML
153-
continue
154150

151+
if app.builder.format != 'html':
152+
# do not modify non-html builders
153+
return
154+
155+
for name, klass in app.registry.translators.items():
155156
translator = types.new_class(
156157
'HoverXRefHTMLTranslator',
157158
(

0 commit comments

Comments
 (0)