Improved video handling in reply #73

Merged
retoor merged 1 commits from BordedDev/snek:bugfix/video-handling-in-reply into main 2025-10-04 19:05:23 +02:00

View File

@ -34,6 +34,12 @@ export class ReplyEvent extends Event {
img.replaceWith(document.createTextNode(src));
});
// Replace <video> with just their src
newMessage.querySelectorAll('video').forEach(vid => {
const src = vid.src || vid.currentSrc || vid.querySelector('source').src;
vid.replaceWith(document.createTextNode(src));
});
// Replace <iframe> with their src
newMessage.querySelectorAll('iframe').forEach(iframe => {
const src = iframe.src || iframe.currentSrc;