Skip to content

Commit

Permalink
Properly serialise css_files and script_files
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Aug 20, 2023
1 parent fde139a commit 5c62ad4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sphinxcontrib/serializinghtml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ def get_target_uri(self, docname: str, typ: str | None = None) -> str:
return docname + SEP

def dump_context(self, context: dict, filename: str | os.PathLike[str]) -> None:
context = context.copy()
if 'css_files' in context:
context['css_files'] = [css.filename for css in context['css_files']]
if 'script_files' in context:
context['script_files'] = [js.filename for js in context['script_files']]
if self.implementation_dumps_unicode:
with open(filename, 'w', encoding='utf-8') as ft:
self.implementation.dump(context, ft, *self.additional_dump_args)
Expand Down

0 comments on commit 5c62ad4

Please sign in to comment.