Context
No response
Bug description
When adding a <script>-Tag via Customization (e.g. to conditionally load scripts depending on target-environment) the material/privacy plugin can produce invalid HTML-Code.
Example:
{% extends "base.html" %}
{% block extrahead %}
{% if config.extra.add_jquery %}
<script defer src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
{% endif %}
{% endblock %}
This generates the following line in the output HTML-file:
<script defer= src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
This seems to always happen if the <script>-Tag uses attributes without values (e.g. "defer" or "async") and if those attributes are placed before the "src"-attribute. In this case the plugin adds an equals-character to that attribute, but does not set a value, resulting in the browser to assume that "src= ...." is the value for the "defer"-attribute.
Related links
Reproduction
9.5.41-privacy-broken-html.zip
Steps to reproduce
See attached zip-archive...
- Create empty mkdocs-material project
- Add material/privacy plugin
- Add customization HTML that adds a script-Tag
- Have some attribute without value added to that script-Tag preceeding the src-attribute
- Run mkdocs build and check the created html-Files
Browser
No response
Before submitting
Context
No response
Bug description
When adding a
<script>-Tag via Customization (e.g. to conditionally load scripts depending on target-environment) the material/privacy plugin can produce invalid HTML-Code.Example:
This generates the following line in the output HTML-file:
This seems to always happen if the
<script>-Tag uses attributes without values (e.g. "defer" or "async") and if those attributes are placed before the "src"-attribute. In this case the plugin adds an equals-character to that attribute, but does not set a value, resulting in the browser to assume that "src= ...." is the value for the "defer"-attribute.Related links
Reproduction
9.5.41-privacy-broken-html.zip
Steps to reproduce
See attached zip-archive...
Browser
No response
Before submitting