Skip to content

Double HTML encoding in blog excerpts produces HTML artifacts #1923

@ukusormus

Description

@ukusormus

https://nixos.org/blog/ post excerpts seem to be double HTML encoded, producing visual text artifacts such as ", & and <.

Visual examples:
Image

Note the posts themselves don't contain these artifacts, as special characters seem correctly HTML encoded once (converting " -> &quot, & -> & etc).

Example from page's source code:

[...] in supporting the Nix & NixOS ecosystem.

Double HTML encoding supposedly happens like this:

<!-- Original: -->
[...] in supporting the Nix & NixOS ecosystem.

<!-- 1st pass: -->
[...] in supporting the Nix &amp; NixOS ecosystem.
<!-- Browser renders as "Nix & NixOS" -->

<!-- 2nd pass: -->
[...] in supporting the Nix &amp;amp; NixOS ecosystem.
<!-- Browser renders as "Nix &amp; NixOS" -->

Likely culprits from code (unverified):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions