-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
Context
No response
Bug description
When running mkdocs build
in a clean working copy of the project for the first time the privacy plugin fails to correctly "internalize" mermaid.min.js
in the generated HTML documents.
Running mkdocs build
a second time - without changing anything else - will correctly reference assets/external/unpkg.com/mermaid@11/dist/mermaid.min.js
.
For example see the diff between the first and the second run on index.html
:
--- a/index_first_run.html
+++ b/index_second_run.html
@@ -263,7 +263,7 @@
<script src="assets/javascripts/bundle.525ec568.min.js"></script>
- <script src="https:/unpkg.com/mermaid@11/dist/mermaid.min.js"></script>
+ <script src="assets/external/unpkg.com/mermaid@11/dist/mermaid.min.js"></script>
</body>
Note: Somehow in the minimal reproducer the diagram is still being rendered (I did not yet figure out how) but in my real world project it is only rendered correctly after the second run. However rerunning mkdocs build
without changing inputs should deterministically produce the same result in my opinion.
PS: Thank you for the great project, I really enjoy mkdocs-material 👍
Related links
Reproduction
9.5.40-mermaid-asset-incorrectly-internalized.zip
Steps to reproduce
- Run
mkdocs build
- Inspect the generated
site/index.html
- It contains
<script src="https:/unpkg.com/mermaid@11/dist/mermaid.min.js"></script>
(in line 266 in my case on the very end of the file just before</body>
)
- Run
mkdocs build
again - Inspect the generated
site/index.html
- It now contains
<script src="assets/external/unpkg.com/mermaid@11/dist/mermaid.min.js"></script>
(in line 266 in my case on the very end of the file just before</body>
)
- This is the only difference between the two files
Browser
No response
Before submitting
- I have read and followed the bug reporting guidelines.
- I have attached links to the documentation, and possibly related issues and discussions.
- I assure that I have removed all customizations before submitting this bug report.
- I have attached a .zip file with a minimal reproduction using the built-in info plugin.