Skip to content

Commit

Permalink
Fixed deprecation warning in privacy plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Apr 29, 2024
1 parent cff4a75 commit ff49d74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions material/plugins/privacy/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,10 @@ def _queue(self, url: URL, config: MkDocsConfig, concurrent = False):
else:
self._fetch(file, config)

# Register external asset as file
self.assets.append(file)
# Register external asset as file - it might have already been
# registered, and since MkDocs 1.6, trigger a deprecation warning
if not self.assets.get_file_from_path(file.src_uri):
self.assets.append(file)

# If the URL of the external asset includes a hash fragment, add it to
# the returned file, e.g. for dark/light images - see https://t.ly/7b16Y
Expand Down
6 changes: 4 additions & 2 deletions src/plugins/privacy/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,10 @@ def _queue(self, url: URL, config: MkDocsConfig, concurrent = False):
else:
self._fetch(file, config)

# Register external asset as file
self.assets.append(file)
# Register external asset as file - it might have already been
# registered, and since MkDocs 1.6, trigger a deprecation warning
if not self.assets.get_file_from_path(file.src_uri):
self.assets.append(file)

# If the URL of the external asset includes a hash fragment, add it to
# the returned file, e.g. for dark/light images - see https://t.ly/7b16Y
Expand Down

0 comments on commit ff49d74

Please sign in to comment.