From 006822c9bbda0983d95801cbc1c2deda1d03c536 Mon Sep 17 00:00:00 2001 From: klarkxy <278370456@qq.com> Date: Fri, 6 Dec 2024 17:12:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0markdown-it=E7=9A=84=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/template/syzoj/problem.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web/template/syzoj/problem.php b/web/template/syzoj/problem.php index 5ae76ff..ec2a78b 100644 --- a/web/template/syzoj/problem.php +++ b/web/template/syzoj/problem.php @@ -123,9 +123,9 @@ if ($pr_flag) { { $s = $str; if (strpos($s, "class='md") !== false) // 没找到,那就加上 - $s = "" . $s .""; + $s = "" . $s . ""; $s = bbcode_to_html($s); - return $s; + return $s; } ?>
@@ -475,7 +475,11 @@ if ($pr_flag) { $(this).html(marked.parse($(this).html())); - const md = window.markdownit(); + const md = window.markdownit()({ + html: true, + linkify: true, + typographer: true + }); $(this).html(md.render($(this).text())); });