Skip to content

Commit

Permalink
Merge pull request #38 from unverbuggt/main
Browse files Browse the repository at this point in the history
add id to appended script tag
  • Loading branch information
blueswen authored May 1, 2024
2 parents 6f99fb8 + c30f049 commit 585944c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mkdocs_glightbox/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def on_post_page(self, output, page, config, **kwargs):
):
# support compatible with mkdocs-material Instant loading feature
js_code = "document$.subscribe(() => {" + js_code + "})"
output = body_regex.sub(f"<body\\1<script>{js_code}</script></body>", output)
output = body_regex.sub(f'<body\\1<script id="init-glightbox">{js_code}</script></body>', output)

return output

Expand Down

0 comments on commit 585944c

Please sign in to comment.