Skip to content

fix(site): keep inline <code> text in app About sections - #26

Merged
jing2uo merged 1 commit into
mainfrom
fix-enrich-inline-code
Jun 23, 2026
Merged

jing2uo merged 1 commit into
mainfrom
fix-enrich-inline-code

Conversation

@jing2uo

@jing2uo jing2uo commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Problem

On app detail pages, the About section silently truncated any opt-in bullet that ends in a command. e.g. org.zennotes.ZenNotes:

Open and keep an existing notes vault outside the sandbox**:** ← the flatpak override … command was missing

Root cause

site/tools/enrich.mjs parses the metainfo <description> with preserveOrder, but orderedText only read top-level #text nodes. A <p>/<li> containing inline <code> becomes [{'#text':'…'}, {code:[…]}], so the <code> child — the actual command — was dropped. This affected every app using the house-style opt-in lists: electerm, Legcord, ZenNotes.

Fix (TDD)

  • Added a failing case (inline <code> in a <p> and a <li>) to tests/test_enrich.sh; confirmed red.
  • orderedText now recurses into inline children; the ordered parser's trimValues is off so the space before <code> survives; whitespace runs are collapsed at the end.
  • Now renders: "…outside the sandbox: flatpak override --user --filesystem=home org.zennotes.ZenNotes" ✓
  • Full suite green (incl. test_publish_e2e).

No registry/descriptor changes — purely the site generator. After merge + site rebuild, the three apps' About sections fill in.

🤖 Generated with Claude Code

enrich.mjs's orderedText only read top-level #text nodes, so with
preserveOrder a <p>/<li> containing inline <code> (e.g. the opt-in
'flatpak override ...' commands) lost the <code> text — the About
bullets rendered truncated. Recurse into inline children and collapse
whitespace; flip the ordered parser's trimValues off so the spaces
around inline elements survive. Affects electerm, Legcord, ZenNotes.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant