Skip to content

Commit 671703c

Browse files
authored
Remove discouraged type="text/javascript" from scripts (#1140)
type="text/javascript" is unnecessary and even discouraged by the specification: “Authors should omit the type attribute instead of redundantly setting it.” https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type It causes the validator to raise warnings, too. Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 2026bb6 commit 671703c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

sphinx_rtd_theme/layout.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@
5757
{%- if not embedded %}
5858
{# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherert more blocks directly from sphinx #}
5959
{%- if sphinx_version >= "1.8.0" -%}
60-
<script type="text/javascript" id="documentation_options" data-url_root="{{ url_root }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
60+
<script id="documentation_options" data-url_root="{{ url_root }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
6161
{%- for scriptfile in script_files %}
6262
{{ js_tag(scriptfile) }}
6363
{%- endfor %}
6464
{%- else %}
65-
<script type="text/javascript">
65+
<script>
6666
var DOCUMENTATION_OPTIONS = {
6767
URL_ROOT:'{{ url_root }}',
6868
VERSION:'{{ release|e }}',
@@ -74,10 +74,10 @@
7474
};
7575
</script>
7676
{%- for scriptfile in script_files %}
77-
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
77+
<script src="{{ pathto(scriptfile, 1) }}"></script>
7878
{%- endfor %}
7979
{%- endif %}
80-
<script type="text/javascript" src="{{ pathto('_static/js/theme.js', 1) }}"></script>
80+
<script src="{{ pathto('_static/js/theme.js', 1) }}"></script>
8181

8282
{#- OPENSEARCH #}
8383
{%- if use_opensearch %}
@@ -209,7 +209,7 @@
209209
</div>
210210
{% include "versions.html" -%}
211211

212-
<script type="text/javascript">
212+
<script>
213213
jQuery(function () {
214214
SphinxRtdTheme.Navigation.enable({{ 'true' if theme_sticky_navigation|tobool else 'false' }});
215215
});

sphinx_rtd_theme/search.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
{% set display_vcs_links = False %}
1313
{%- block scripts %}
1414
{{ super() }}
15-
<script type="text/javascript" src="{{ pathto('_static/searchtools.js', 1) }}"></script>
16-
<script type="text/javascript" src="{{ pathto('_static/language_data.js', 1) }}"></script>
15+
<script src="{{ pathto('_static/searchtools.js', 1) }}"></script>
16+
<script src="{{ pathto('_static/language_data.js', 1) }}"></script>
1717
{%- endblock %}
1818
{% block footer %}
19-
<script type="text/javascript">
19+
<script>
2020
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
2121
</script>
2222
{# this is used when loading the search index using $.ajax fails,
2323
such as on Chrome for documents on localhost #}
24-
<script type="text/javascript" id="searchindexloader"></script>
24+
<script id="searchindexloader"></script>
2525
{{ super() }}
2626
{% endblock %}
2727
{% block body %}

0 commit comments

Comments
 (0)