Skip to content

Commit 5c62ad4

Browse files
committed
Properly serialise css_files and script_files
1 parent fde139a commit 5c62ad4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sphinxcontrib/serializinghtml/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ def get_target_uri(self, docname: str, typ: str | None = None) -> str:
6363
return docname + SEP
6464

6565
def dump_context(self, context: dict, filename: str | os.PathLike[str]) -> None:
66+
context = context.copy()
67+
if 'css_files' in context:
68+
context['css_files'] = [css.filename for css in context['css_files']]
69+
if 'script_files' in context:
70+
context['script_files'] = [js.filename for js in context['script_files']]
6671
if self.implementation_dumps_unicode:
6772
with open(filename, 'w', encoding='utf-8') as ft:
6873
self.implementation.dump(context, ft, *self.additional_dump_args)

0 commit comments

Comments
 (0)