默认起用markdown-it的所有配置
This commit is contained in:
@@ -123,8 +123,10 @@ if ($pr_flag) {
|
|||||||
{
|
{
|
||||||
$s = $str;
|
$s = $str;
|
||||||
$s = bbcode_to_html($s);
|
$s = bbcode_to_html($s);
|
||||||
if (strpos($s, "class='md") === false &&
|
if (
|
||||||
strpos($s, "class=\"md") === false) // 没找到,那就加上
|
strpos($s, "class='md") === false &&
|
||||||
|
strpos($s, "class=\"md") === false
|
||||||
|
) // 没找到,那就加上
|
||||||
$s = "<span class='md'>" . $s . "</span>";
|
$s = "<span class='md'>" . $s . "</span>";
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
@@ -477,6 +479,11 @@ if ($pr_flag) {
|
|||||||
$(this).html(marked.parse($(this).html()));
|
$(this).html(marked.parse($(this).html()));
|
||||||
<?php } else if ($OJ_MARKDOWN && $OJ_MARKDOWN == "markdown-it") { ?>
|
<?php } else if ($OJ_MARKDOWN && $OJ_MARKDOWN == "markdown-it") { ?>
|
||||||
const md = window.markdownit();
|
const md = window.markdownit();
|
||||||
|
md.set({
|
||||||
|
html: true,
|
||||||
|
linkify: true,
|
||||||
|
typographer: true,
|
||||||
|
})
|
||||||
$(this).html(md.render($(this).html()));
|
$(this).html(md.render($(this).html()));
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user