Skip to content

[FEATURE]: skip type="text/javascript" attribute in <script> tag of HTML output #5449

@hannob

Description

@hannob

Description

plotly.py's HTML output of the write_html() function currently adds a type attribute to the script tag, which is discouraged and causes a warning in the HTML validator:
<script type="text/javascript">

Why should this feature be added?

Standard Javascript code is the default for the <script> tag in HTML, adding a type attribute to declare that default is unnecessary.
The current HTML5 spec explicitly discourages setting it:
"Omitting the attribute, setting it to the empty string, or setting it to a JavaScript MIME type essence match means that the script is a classic script, to be interpreted according to the JavaScript Script top-level production. Authors should omit the type attribute instead of redundantly setting it."

Source: https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type

Metadata

Metadata

Assignees

Labels

P2considered for next cyclefeaturesomething newgood first issuesuitable for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions