-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
bugIssue reports a bugIssue reports a bugresolvedIssue is resolved, yet unreleased if openIssue is resolved, yet unreleased if open
Description
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
- Documentation for Privacy-Plugin -> not setting found to disable this behavior
- Current Issues -> no issues found that look related
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
- I have read and followed the bug reporting guidelines.
- I have attached links to the documentation, and possibly related issues and discussions.
- I assure that I have removed all customizations before submitting this bug report.
- I have attached a .zip file with a minimal reproduction using the built-in info plugin.
Metadata
Metadata
Assignees
Labels
bugIssue reports a bugIssue reports a bugresolvedIssue is resolved, yet unreleased if openIssue is resolved, yet unreleased if open