Skip to content

Add apply_body_background config toggle and XSS fix#101

Merged
elasticsounds merged 1 commit intomainfrom
elasticsounds/kid-friendly-styleguide
Feb 20, 2026
Merged

Add apply_body_background config toggle and XSS fix#101
elasticsounds merged 1 commit intomainfrom
elasticsounds/kid-friendly-styleguide

Conversation

@elasticsounds
Copy link
Contributor

Summary

Add apply_body_background boolean config option (default true) to control whether background colors extracted from content are applied to the page body. Thread through all rendering paths: packaging, API preview, and live preview. Also fixes XSS/CSS injection vulnerability where bgMatch[1] was interpolated without escapeAttr(). Includes Sri Lanka Grade 2 styleguide assets.

Changes

  • Add apply_body_background to AppConfig schema
  • Make background extraction conditional in renderPageHtml()
  • Fix CSS injection by wrapping with escapeAttr()
  • Thread config through packaging routes, services, and pipeline runners
  • Add UI toggle in onboarding wizard step 2 (Layout) under Advanced settings
  • Add UI toggle in Storyboard settings for runtime control
  • Add toggle to BookPreviewFrame and StoryboardSectionDetail for live preview

Test Plan

  • Verify typecheck passes ✓
  • Toggle off in onboarding — new book should have white body
  • Toggle on in onboarding — new book should apply styleguide backgrounds
  • In existing book storyboard settings, toggle to control preview backgrounds
  • Verify packaged output respects the toggle

Add apply_body_background boolean config option (default true) to control whether background colors extracted from content are applied to the page body. Thread through packaging, API preview, and live preview. Also fix XSS/CSS injection where bgMatch[1] was interpolated without escapeAttr(). Add Sri Lanka Grade 2 styleguide assets.
@elasticsounds elasticsounds merged commit 91e140f into main Feb 20, 2026
1 check 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