Changeset a85f539 in Klonkt for src/services/HtmlSanitizerService.js
- Timestamp:
- 07/16/2026 12:20:51 PM (8 weeks ago)
- Branches:
- main
- Children:
- e276d03
- Parents:
- 8e7f0ec
- git-author:
- Robin <roboburr@…> (07/12/2026 10:30:07 PM)
- git-committer:
- Robin <roboburr@…> (07/16/2026 12:20:51 PM)
- File:
-
- 1 edited
-
src/services/HtmlSanitizerService.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/services/HtmlSanitizerService.js
r8e7f0ec ra85f539 25 25 'strong', 'em', 'b', 'i', 'u', 's', 'mark', 'small', 'sub', 'sup', 26 26 'code', 'a', 'span', 'img', 27 // Native media (bare .webm/.mp4/.mp3 embeds + federated-in players) 28 'video', 'audio', 'source', 27 29 ]; 28 30 29 31 // Per-tag attribute allowlist. '*' applies to every tag. 30 32 const ALLOWED_ATTRS = { 31 '*': ['class', 'id', 'dir', 'lang', 'data-sc'], 32 a: ['href', 'title', 'target', 'rel'], 33 img: ['src', 'alt', 'title', 'width', 'height', 'loading'], 33 '*': ['class', 'id', 'dir', 'lang', 'data-sc'], 34 a: ['href', 'title', 'target', 'rel'], 35 img: ['src', 'alt', 'title', 'width', 'height', 'loading'], 36 video: ['src', 'controls', 'preload', 'poster', 'width', 'height', 'loop', 'muted', 'autoplay', 'playsinline'], 37 audio: ['src', 'controls', 'preload', 'loop', 'muted', 'autoplay'], 38 source: ['src', 'type'], 34 39 }; 35 40 36 41 const ALLOWED_SCHEMES = ['http', 'https', 'mailto', 'tel']; 37 42 const ALLOWED_SCHEMES_BY_TAG = { 38 img: ['http', 'https', 'data'], 39 a: ['http', 'https', 'mailto', 'tel'], 43 img: ['http', 'https', 'data'], 44 a: ['http', 'https', 'mailto', 'tel'], 45 video: ['http', 'https'], 46 audio: ['http', 'https'], 47 source: ['http', 'https'], 40 48 }; 41 49
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)