mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2025-02-17 10:48:34 +01:00
Fixed race condition in privacy plugin
This commit is contained in:
parent
39d14d5c19
commit
92089c67f1
@ -96,11 +96,9 @@ class PrivacyPlugin(BasePlugin[PrivacyConfig]):
|
|||||||
# automatically loads Mermaid.js when a Mermaid diagram is
|
# automatically loads Mermaid.js when a Mermaid diagram is
|
||||||
# found in the page - https://bit.ly/36tZXsA.
|
# found in the page - https://bit.ly/36tZXsA.
|
||||||
if "mermaid.min.js" in url.path and not config.site_url:
|
if "mermaid.min.js" in url.path and not config.site_url:
|
||||||
path = url.geturl()
|
script = ExtraScriptValue(url.geturl())
|
||||||
if path not in config.extra_javascript:
|
if script not in config.extra_javascript:
|
||||||
config.extra_javascript.append(
|
config.extra_javascript.append(script)
|
||||||
ExtraScriptValue(path)
|
|
||||||
)
|
|
||||||
|
|
||||||
# The local asset references at least one external asset, which
|
# The local asset references at least one external asset, which
|
||||||
# means we must download and replace them later
|
# means we must download and replace them later
|
||||||
@ -149,6 +147,10 @@ class PrivacyPlugin(BasePlugin[PrivacyConfig]):
|
|||||||
if not self._is_excluded(url, page.file):
|
if not self._is_excluded(url, page.file):
|
||||||
self._queue(url, config, concurrent = True)
|
self._queue(url, config, concurrent = True)
|
||||||
|
|
||||||
|
# Sync all concurrent jobs
|
||||||
|
def on_env(self, env, *, config, files):
|
||||||
|
wait(self.pool_jobs)
|
||||||
|
|
||||||
# Process external assets in template (run later)
|
# Process external assets in template (run later)
|
||||||
@event_priority(-50)
|
@event_priority(-50)
|
||||||
def on_post_template(self, output_content, *, template_name, config):
|
def on_post_template(self, output_content, *, template_name, config):
|
||||||
|
@ -96,11 +96,9 @@ class PrivacyPlugin(BasePlugin[PrivacyConfig]):
|
|||||||
# automatically loads Mermaid.js when a Mermaid diagram is
|
# automatically loads Mermaid.js when a Mermaid diagram is
|
||||||
# found in the page - https://bit.ly/36tZXsA.
|
# found in the page - https://bit.ly/36tZXsA.
|
||||||
if "mermaid.min.js" in url.path and not config.site_url:
|
if "mermaid.min.js" in url.path and not config.site_url:
|
||||||
path = url.geturl()
|
script = ExtraScriptValue(url.geturl())
|
||||||
if path not in config.extra_javascript:
|
if script not in config.extra_javascript:
|
||||||
config.extra_javascript.append(
|
config.extra_javascript.append(script)
|
||||||
ExtraScriptValue(path)
|
|
||||||
)
|
|
||||||
|
|
||||||
# The local asset references at least one external asset, which
|
# The local asset references at least one external asset, which
|
||||||
# means we must download and replace them later
|
# means we must download and replace them later
|
||||||
@ -149,6 +147,10 @@ class PrivacyPlugin(BasePlugin[PrivacyConfig]):
|
|||||||
if not self._is_excluded(url, page.file):
|
if not self._is_excluded(url, page.file):
|
||||||
self._queue(url, config, concurrent = True)
|
self._queue(url, config, concurrent = True)
|
||||||
|
|
||||||
|
# Sync all concurrent jobs
|
||||||
|
def on_env(self, env, *, config, files):
|
||||||
|
wait(self.pool_jobs)
|
||||||
|
|
||||||
# Process external assets in template (run later)
|
# Process external assets in template (run later)
|
||||||
@event_priority(-50)
|
@event_priority(-50)
|
||||||
def on_post_template(self, output_content, *, template_name, config):
|
def on_post_template(self, output_content, *, template_name, config):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user