Skip to content

fix: escape titleSlam data text - #156

Merged
Brad-Edwards merged 1 commit into
devfrom
149-title-slam-escape
May 24, 2026
Merged

fix: escape titleSlam data text#156
Brad-Edwards merged 1 commit into
devfrom
149-title-slam-escape

Conversation

@Brad-Edwards

@Brad-Edwards Brad-Edwards commented May 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Harden titleSlam word rendering by creating word spans through DOM APIs so title content cannot break out of the data-text attribute while preserving the glitch CSS contract.

Requirement UIDs

  • (none — bug/refactor/maintenance run; see Traceability section below)

Related Issues

Closes #149

ADR Impact

  • ADR-005
  • ADR-008

Changes

  • Render title word spans with ownerDocument.createElement, textContent, and dataset.text instead of raw span HTML.
  • Extend template DOM typing to include className for DOM-created template nodes.
  • Add regression coverage for quoted and angle-bracket title content, plus DOM assertions for optional template branches.
  • Add a security changelog fragment.

Test Plan

Codex pre-push review was clean. Test-quality cycle 1 found optional-branch lifecycle-only tests; those tests now assert their rendered DOM. No over-cap test-quality cycle was run by request.

Ground Control Checks

  • Implementation plan posted
  • Completion gate passed
  • Codex review clean
  • CI green
  • SonarCloud quality gate OK, 0 open issues, 0 open hotspots

Traceability

Checklist

@sonarqubecloud

Copy link
Copy Markdown

@Brad-Edwards
Brad-Edwards merged commit d8c76e2 into dev May 24, 2026
9 checks passed
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