Files
apes-sidebar/tests/e2e
ymac f5ffd10474 fix(markdown): render anchors without a stray close tag and keep <details> summaries as direct children
Two raw-HTML preview defects (client rendering only, no DSH source touched):

- A stray `</a>` from an author's `<a id="x"></a>` was printed as literal text.
  The host renderer emits one text node per raw-HTML token, so the open tag and
  its close tag arrive as siblings; DOMPurify drops a lone close tag (no element
  children), which fell into the inline pass's "no elements means prose, keep
  the text" branch. The pass now deletes a node that is nothing but a close tag,
  keeping the anchor id and leaving comparison prose (`a < b`, `x </ y`) intact.
- A `<details>` fold showed the UA's own "Details" label while the authored
  summary text dropped into the body: `<summary>…</summary>` is a balanced span,
  so analyzeHtmlSegment reduced it to an `html` leaf wrapped in a block div,
  which is not a direct child of `<details>` and therefore not honored as the
  disclosure widget. The renderer now hoists a leaf-leading summary into a real
  `<summary>` element inside its details frame (attributes via the shared props
  extraction, media/anchors still hardened), with no hardcoded label.

Also scope `.editorMd details > summary { cursor: pointer }` so a hoisted
summary keeps its pointer cursor (the old `.editorHtmlBlock summary` rule no
longer matches once it leaves the leaf wrapper).

Tests: 8 new/tightened cases in tests/markdown-html-render.spec.tsx (13 -> 21),
plus a seeded anchor and direct-child summary assertions in the real mount
smoke (tests/e2e/mount.e2e.ts). Verified pnpm test (113 files / 1140 passed),
typecheck, lint, and pnpm test:mount (7/7).

Fixes #778
2026-09-27 19:45:17 +08:00
..