From 7a0ea9d90ebcfa6e4a252c55d2636a844e3f5b3d Mon Sep 17 00:00:00 2001 From: JustAMacUser Date: Fri, 15 May 2020 22:25:56 -0400 Subject: Make iframes size responsively. --- include/functions.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index 707a87e94..57acb7a24 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1373,6 +1373,14 @@ $doc->removeChild($doc->firstChild); //remove doctype $doc = strip_harmful_tags($doc, $allowed_elements, $disallowed_attributes); + $entries = $xpath->query('//iframe'); + foreach ($entries as $entry) { + $div = $doc->createElement('div'); + $div->setAttribute('class', 'embed-responsive'); + $entry->parentNode->replaceChild($div, $entry); + $div->appendChild($entry); + } + if ($highlight_words && is_array($highlight_words)) { foreach ($highlight_words as $word) { -- cgit v1.2.3