-
-
Notifications
You must be signed in to change notification settings - Fork 354
Open
Description
https://nixos.org/blog/ post excerpts seem to be double HTML encoded, producing visual text artifacts such as ", & and <.
Note the posts themselves don't contain these artifacts, as special characters seem correctly HTML encoded once (converting " -> ", & -> & etc).
Example from page's source code:
[...] in supporting the Nix &amp; NixOS ecosystem.Double HTML encoding supposedly happens like this:
<!-- Original: -->
[...] in supporting the Nix & NixOS ecosystem.
<!-- 1st pass: -->
[...] in supporting the Nix & NixOS ecosystem.
<!-- Browser renders as "Nix & NixOS" -->
<!-- 2nd pass: -->
[...] in supporting the Nix &amp; NixOS ecosystem.
<!-- Browser renders as "Nix & NixOS" -->Likely culprits from code (unverified):
- first encoding pass, MarkdownIt for creating excerpts:
nixos-homepage/core/src/lib/utils.js
Lines 14 to 15 in aa54c73
export function createExcerpt(post) { const parser = new MarkdownIt(); - second encoding pass, Astro template where the excerpt is included in:
<p class="font-extralight">{createExcerpt(post.body)}...</p>
Metadata
Metadata
Assignees
Labels
No labels
