Procházet zdrojové kódy

Revert "fix support single-quoted classes in KP markdown parsing"

This reverts commit c162b9b6862721de125df7b83d7d0e7e5a1d3194.
yemeishu před 1 měsícem
rodič
revize
0800a3cb5c
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      app/Services/ExamPdfExportService.php

+ 2 - 2
app/Services/ExamPdfExportService.php

@@ -1933,9 +1933,9 @@ class ExamPdfExportService
         $parser = new \Michelf\MarkdownExtra;
 
         return preg_replace_callback(
-            '/<div[^>]*class=(["\'])[^"\']*\bkp-markdown-source\b[^"\']*\1[^>]*>([\s\S]*?)<\/div>(?:\s*<div[^>]*class=(["\'])[^"\']*\bkp-markdown-container\b[^"\']*\3[^>]*>[\s\S]*?<\/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[2]), ENT_QUOTES, 'UTF-8');
+                $markdown = html_entity_decode(trim($matches[1]), ENT_QUOTES, 'UTF-8');
                 $rendered = $parser->transform($markdown);
 
                 return '<div class="kp-markdown-container kp-markdown-content">'.$rendered.'</div>';