Improve article embedding by allowing YouTube videos and adding accessibility attributes
Allow YouTube embeds in articles by updating DOMPurify configuration to include the 'title' attribute for iframes and ensuring proper sanitization. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 4b93164f-6fc8-4e6f-b10f-1f5cff30e9c0 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/jdAEdU5 Replit-Helium-Checkpoint-Created: true
This commit is contained in:
parent
87797a2ffa
commit
2f2a80189e
BIN
attached_assets/image_1772624594708.png
Normal file
BIN
attached_assets/image_1772624594708.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 143 KiB |
@ -26,7 +26,7 @@ const ALLOWED_IFRAME_DOMAINS = [
|
||||
function sanitizeContent(html: string): string {
|
||||
return DOMPurify.sanitize(html, {
|
||||
ADD_TAGS: ["iframe", "blockquote"],
|
||||
ADD_ATTR: ["allow", "allowfullscreen", "frameborder", "scrolling", "src", "loading", "style", "class", "data-instgrm-permalink", "data-instgrm-version", "data-instgrm-captioned", "cite"],
|
||||
ADD_ATTR: ["allow", "allowfullscreen", "frameborder", "scrolling", "src", "loading", "style", "class", "title", "data-instgrm-permalink", "data-instgrm-version", "data-instgrm-captioned", "cite"],
|
||||
ALLOW_UNKNOWN_PROTOCOLS: false,
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user