]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Tools/ExportFormatter.php
Replaced embeds with images in exports
[bookstack] / app / Entities / Tools / ExportFormatter.php
index ed3e8d326f693c290eafba1c387b06b0abc27e55..cda8e0308892259b95aa206ca01d3cf44a19143a 100644 (file)
@@ -215,9 +215,12 @@ class ExportFormatter
      */
     protected function containHtml(string $htmlContent): string
     {
+        // Replace embed tags with images
+        $htmlContent = preg_replace("/<embed (.*?)>/i", '<img $1>', $htmlContent);
+
         // Replace image & embed src attributes with base64 encoded data strings
         $imageTagsOutput = [];
-        preg_match_all("/<(?:img|embed) .*?src=['\"](.*?)['\"].*?>/i", $htmlContent, $imageTagsOutput);
+        preg_match_all("/<img .*?src=['\"](.*?)['\"].*?>/i", $htmlContent, $imageTagsOutput);
         if (isset($imageTagsOutput[0]) && count($imageTagsOutput[0]) > 0) {
             foreach ($imageTagsOutput[0] as $index => $imgMatch) {
                 $oldImgTagString = $imgMatch;