Skip to content

Commit

Permalink
Fix slice assignment in update_context() causing removal of other ext…
Browse files Browse the repository at this point in the history
…ension JS scripts (#181)
  • Loading branch information
mathpl committed Oct 22, 2023
1 parent 1256852 commit 973a049
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sphinx_tabs/tabs.py
Expand Up @@ -325,12 +325,12 @@ def update_context(app, pagename, templatename, context, doctree):
if not visitor.found_tabs_directive and not include_assets_in_all_pages:
paths = [Path("_static") / f for f in FILES]
if "css_files" in context:
context["css_files"] = context["css_files"][:]
context["css_files"][:] = context["css_files"]
for path in paths:
if path.suffix == ".css" and path in context["css_files"]:
context["css_files"].remove(path.as_posix())
if "script_files" in context:
context["script_files"] = context["script_files"][:]
context["script_files"][:] = context["script_files"]
for path in paths:
if path.suffix == ".js" and path.as_posix() in context["script_files"]:
context["script_files"].remove(path.as_posix())
Expand Down

0 comments on commit 973a049

Please sign in to comment.