Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
Guts opened this issue Feb 21, 2023 · 2 comments
Closed
4 tasks done

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

Guts opened this issue Feb 21, 2023 · 2 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@Guts
Copy link
Contributor

Guts commented Feb 21, 2023

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

@squidfunk squidfunk added the bug Issue reports a bug label Feb 21, 2023
@squidfunk
Copy link
Owner

Thanks for reporting! Fixed in e34ad9182.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Feb 22, 2023
@squidfunk
Copy link
Owner

Released as part of 9.0.14+insiders-4.32.1.

Guts added a commit to geotribu/website that referenced this issue Feb 23, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants