Feature #174: marked + DOMPurify markdown #175
No reviewers
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub!175
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/issue-174"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements #174 (D-WEB-7, explicit user amendment).
contract), class=language-* (nothing consumed data-lang), renderBody throws without DOM.
Replace hand-rolled markdown-lite (web/src/lib/markdown.js) and allowlist sanitizer (web/src/lib/sanitize.js) with marked@18.0.11 (MIT) + dompurify@3.4.15 (MPL-2.0-or-Apache-2.0), both zero-dependency, behind one wrapper module web/src/lib/render-md.js (marked GFM + pinned DOMPurify ALLOWED_TAGS/ALLOWED_ATTR incl. del/s/input/checked/disabled/type/class, FORBID_CONTENTS for the old drop-content set). Five call sites (Blob, Tree, Release, IssueNew, ThreadTimeline) render innerHTML={renderBody(...)}; old modules deleted (pre-1.0 rule). Conscious mappings: breaks:true preserves the <br> continuation contract; fenced code keeps marked's class="language-*" (nothing consumed data-lang); renderBody throws without a DOM (fail closed), marked layer stays Node-importable. Bundle delta +22.2 KB gzip on the shipped vite bundle (422.71 kB / 123.52 kB gzip vs 356.55 kB / 101.34 kB pre-change; budget <= ~25 KB). Tests: node --test 363/363 green; make web clean; real-Chromium pass 14/14 (task/table/strike/autolink, script+content and javascript:/data: drops, disabled checkboxes, dark+light identical) with zero console errors; / and /setup load in Chromium with zero console errors.