tabatkins / railroad-diagrams

:steam_locomotive: A small JS+SVG library for drawing railroad syntax diagrams, like on JSON.org. Now with a Python port!
MIT License
1.66k stars 153 forks source link

Diagram.addTo() doesn't find the right <script> tag for <script type=module> #108

Open RossPatterson opened 10 months ago

RossPatterson commented 10 months ago

When using the Diagram.addTo() method in railroad.js without specifying a target element, the method cannot determine the correct <script> tag if the tag has type=module coded. This is because ES Module scripts, even in-line ones, are forced to be <script defer>, causing them to be run out of order, making the code that locates the <script> tag locate the wrong one.