mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
committed by
GitHub
parent
38950840e0
commit
c4552e9c10
@@ -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 &&
|
||||
|
Reference in New Issue
Block a user