From 6f20a9ef7397479a24f9e281464be88ce412c0a2 Mon Sep 17 00:00:00 2001 From: klarkxy <278370456@qq.com> Date: Fri, 6 Dec 2024 18:16:12 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=B5=B7=E7=94=A8markdown-it?= =?UTF-8?q?=E7=9A=84=E6=89=80=E6=9C=89=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/template/syzoj/problem.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/template/syzoj/problem.php b/web/template/syzoj/problem.php index cf8b55a..e430e15 100644 --- a/web/template/syzoj/problem.php +++ b/web/template/syzoj/problem.php @@ -123,8 +123,10 @@ if ($pr_flag) { { $s = $str; $s = bbcode_to_html($s); - if (strpos($s, "class='md") === false && - strpos($s, "class=\"md") === false) // 没找到,那就加上 + if ( + strpos($s, "class='md") === false && + strpos($s, "class=\"md") === false + ) // 没找到,那就加上 $s = "" . $s . ""; return $s; } @@ -477,6 +479,11 @@ if ($pr_flag) { $(this).html(marked.parse($(this).html())); const md = window.markdownit(); + md.set({ + html: true, + linkify: true, + typographer: true, + }) $(this).html(md.render($(this).html())); });