mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-12-18 10:25:58 +01:00
Fixed privacy plugin interop with generated files
This commit is contained in:
parent
c97270c8f1
commit
968fbe1ae2
@ -268,6 +268,11 @@ class PrivacyPlugin(BasePlugin[PrivacyConfig]):
|
|||||||
if extension not in self.assets_expr_map:
|
if extension not in self.assets_expr_map:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
# Skip if source path is not set, which might be true for generated
|
||||||
|
# files or for files that were added programatically in plugins
|
||||||
|
if not initiator.abs_src_path:
|
||||||
|
return []
|
||||||
|
|
||||||
# Find and extract all external asset URLs
|
# Find and extract all external asset URLs
|
||||||
expr = re.compile(self.assets_expr_map[extension], flags = re.I | re.M)
|
expr = re.compile(self.assets_expr_map[extension], flags = re.I | re.M)
|
||||||
with open(initiator.abs_src_path, encoding = "utf-8-sig") as f:
|
with open(initiator.abs_src_path, encoding = "utf-8-sig") as f:
|
||||||
|
@ -268,6 +268,11 @@ class PrivacyPlugin(BasePlugin[PrivacyConfig]):
|
|||||||
if extension not in self.assets_expr_map:
|
if extension not in self.assets_expr_map:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
# Skip if source path is not set, which might be true for generated
|
||||||
|
# files or for files that were added programatically in plugins
|
||||||
|
if not initiator.abs_src_path:
|
||||||
|
return []
|
||||||
|
|
||||||
# Find and extract all external asset URLs
|
# Find and extract all external asset URLs
|
||||||
expr = re.compile(self.assets_expr_map[extension], flags = re.I | re.M)
|
expr = re.compile(self.assets_expr_map[extension], flags = re.I | re.M)
|
||||||
with open(initiator.abs_src_path, encoding = "utf-8-sig") as f:
|
with open(initiator.abs_src_path, encoding = "utf-8-sig") as f:
|
||||||
|
Loading…
Reference in New Issue
Block a user