Parcourir la source

Merge branch 'ye/fix-kp-markdown-parse' into main

yemeishu il y a 2 semaines
Parent
commit
5c172aae5a
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      app/Services/ExamPdfExportService.php

+ 1 - 1
app/Services/ExamPdfExportService.php

@@ -1933,7 +1933,7 @@ class ExamPdfExportService
         $parser = new \Michelf\MarkdownExtra;
 
         return preg_replace_callback(
-            '/<div class="kp-markdown-source"[^>]*>([\s\S]*?)<\/div>\s*<div class="kp-markdown-container[^"]*"[^>]*><\/div>/i',
+            '/<div[^>]*class="[^"]*\bkp-markdown-source\b[^"]*"[^>]*>([\s\S]*?)<\/div>(?:\s*<div[^>]*class="[^"]*\bkp-markdown-container\b[^"]*"[^>]*>[\s\S]*?<\/div>)?/i',
             function ($matches) use ($parser) {
                 $markdown = html_entity_decode(trim($matches[1]), ENT_QUOTES, 'UTF-8');
                 $rendered = $parser->transform($markdown);