Skip to content

Built-in privacy plugin breaks image alt text encoding #5077

@Guts

Description

@Guts

Context

Adding some image alt text and description with special chars that appear bad encoded, visible to end-reader through glightbox plugin.

Bug description

Mkdocs.yml :

site_name: "Test Material image title encoding"

theme:
  name: material
  font: false

plugins:
  - info
  - privacy

Input markdown:

# Welcome to MkDocs

For full documentation visit [mkdocs.org](https://www.mkdocs.org).

## Commands

* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.

## Project layout

    mkdocs.yml    # The configuration file.
    docs/
        index.md  # The documentation homepage.
        ...       # Other markdown pages, images and other files.

## Image with title

![Cette capture d'écran est très intéressante](https://squidfunk.github.io/mkdocs-material/assets/screenshots/navigation-tabs.png)

Output HTML :

[...]
<h2 id="image-with-title">Image with title</h2>
<p>
  <img
    alt="Cette capture d'écran est très intéressante"
    src="assets/external/squidfunk.github.io/mkdocs-material/assets/screenshots/navigation-tabs.png"
  />
</p>
[...]

Related links

Reproduction

example.zip

Steps to reproduce

  1. Add privacy to mkdocs.yml
  2. Add image with an alt text with special characters.
  3. Build & look at the HTML

Browser

Chrome, Firefox

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions