Skip to content

Missing HTML encoding in generated HTML #121

@mephinet

Description

@mephinet

Context

While diffing the generated output of mkdocs vs zensical, I noticed that the stylesheet link contains an ampersand that is not encoded.

Bug description

Zensical's output:

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">

Comparing this to mkdocs' output:

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&amp;display=fallback">

IMHO mkdocs is the way to go, as entities in attribute values need to be correctly escaped as well.

Related links

Reproduction

Reproducer: https://github.com/mephinet/zensical-whitespace-reproducer/archive/refs/heads/main.zip

Steps to reproduce

grep Roboto the site/index.html

Browser

No response

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions