Skip to content

Commit bd8ced2

Browse files
committed
Improve handling of nbsp in rst_prolog when added by other extensions.
1 parent 87cd421 commit bd8ced2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sphinx_autofixture/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,11 @@ def validate_config(app: Sphinx, config: Config):
183183
:param config:
184184
"""
185185

186-
rst_prolog = StringList(config.rst_prolog or '')
186+
rst_prolog: Union[str, StringList] = config.rst_prolog or ''
187187

188188
nbsp_sub = ".. |nbsp| unicode:: 0xA0\n :trim:"
189189
if nbsp_sub not in rst_prolog:
190+
rst_prolog = StringList(rst_prolog)
190191
rst_prolog.append(nbsp_sub)
191192

192193
config.rst_prolog = str(rst_prolog) # type: ignore

0 commit comments

Comments
 (0)