You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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 👍
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>)
Thanks for reporting. This seems to be a race condition. I think it might be fixed with 92089c6, at least I can't reproduce it anymore. Please give that a try, and come back to us whether this solves the problem.
I can confirm that I also cannot reproduce the issue anymore. I did try with the reproducer as well as with my real world project. Both look fine now and the diagrams are rendered on first build now 👍
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 referenceassets/external/unpkg.com/mermaid@11/dist/mermaid.min.js
.For example see the diff between the first and the second run on
index.html
: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
mkdocs build
site/index.html
<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>
)mkdocs build
againsite/index.html
<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>
)Browser
No response
Before submitting
The text was updated successfully, but these errors were encountered: