-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[BUG] executes scripts twice #906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Did you face the execution of the script twice ? or its because of the code ? i I think this might help, (though not 100% sure )
You can see the example here I hope this helps. |
Sorry for the late reply, but I saw Docsify running the script from the markdown (not the HTML template) twice. I need to investigate this, and will re-open this as a reminder. |
#1732 might possibly lead to clues: |
Not seeing this behavior on 4.12.1. or 4.12.2. Closing for now, but feel free to reopen if the issue is reproducible. |
Bug Report
If
executeScript
istrue
, then Docsify executes the content of the<script>
twice. This causes bugs. Users don't expect a script tag to run twice.Steps to reproduce
Just look here:
https://github.com/docsifyjs/docsify/blob/develop/src/core/render/index.js#L51-L64
That conditional statement will execute the content of the script by calling
executeScript
, and the browser will also naturally execute the script when the<script>
is inserted into the DOM.What is current behaviour
It executes the script twice!
What is the expected behaviour
Scripts should be executed only once.
Other relevant information
Bug does still occur when all/other plugins are disabled?
Docsify version: 4.9.4
The text was updated successfully, but these errors were encountered: