Skip to content

[BUG] executes scripts twiceΒ #906

Closed
Closed
@trusktr

Description

@trusktr

Bug Report

If executeScript is true, 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

Metadata

Metadata

Assignees

Labels

bugconfirmed as a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions