FIX: Autoplay videos must always be muted (#11533)

This automatically adds the muted attribute if it's missing in a video
tag.

Co-authored-by: David Taylor <david@taylorhq.com>
This commit is contained in:
Rafael dos Santos Silva
2020-12-21 14:55:00 -03:00
committed by GitHub
parent 38950840e0
commit c4552e9c10
3 changed files with 39 additions and 1 deletions

View File

@@ -126,6 +126,12 @@ export function sanitize(text, allowLister) {
return "-STRIP-";
}
if (tag === "video" && name === "autoplay") {
// This might give us duplicate 'muted' atttributes
// but they will be deduped by later processing
return "autoplay muted";
}
// Heading ids must begin with `heading--`
if (
["h1", "h2", "h3", "h4", "h5", "h6"].indexOf(tag) !== -1 &&