Closed maxbrokman closed 1 year ago
Thanks a lot for your contribution.
Could you describe in detail the problem you wanted to solve (what is esm, etc.), and how you solved it?
Ah very sorry @fralau I have sent this to the wrong upstream! Was originally intending to review internally before pushing here but I will update the description shortly
Thanks a lot. I believe the right thing to do would be to open an issue to start the discussion and then, when needed the pull request. Looking forward!
@fralau have now provided a description, sorry about that
I did my own implementation (to guarantee compatibility with earlier versions). Released in 1.0.0.
this is not yet pushed to pypi - is this planned?
Fixes #70
Changes
extra_javascript
is no longer possible for version >= 10. This probably requires readme changes not included in this PR. It may be possible for users to include a simple JS file that imports mermaid via esm here instead.Context
From mermaid v10 onwards mermaid is only distributed as an ESM module. See Mermaid #3590 for discussion on this change.
Users will probably notice this problem if they are following the readme recommended way of loading the latest version of mermaid through
extra_javascript
as includinghttps://unpkg.com/mermaid/dist/mermaid.min.js
resolves to e.ghttps://unpkg.com/mermaid@10.0.2/dist/mermaid.min.js
which does not exist.Looking around other projects this seems to be a common issue for libraries including mermaid.
To resolve this mermaid must now be explicitly imported through e.g
To achieve this this PR makes several changes:
<script src="...">
or<script type="module">
as appropriate.