mirror of
https://github.com/mashirozx/sakura.git
synced 2024-11-22 06:48:12 +08:00
commit
f829ab4b60
@ -1817,6 +1817,7 @@ function markdown_parser($incoming_comment)
|
||||
return $incoming_comment;
|
||||
}
|
||||
add_filter('preprocess_comment', 'markdown_parser');
|
||||
remove_filter( 'comment_text', 'make_clickable', 9 );
|
||||
|
||||
//保存Markdown评论
|
||||
function save_markdown_comment($comment_ID, $comment_approved)
|
||||
|
@ -17,7 +17,7 @@ class Parsedown
|
||||
{
|
||||
# ~
|
||||
|
||||
const version = '1.7.3';
|
||||
const version = '1.7.4';
|
||||
|
||||
# ~
|
||||
|
||||
@ -1489,22 +1489,41 @@ class Parsedown
|
||||
}
|
||||
}
|
||||
|
||||
$permitRawHtml = false;
|
||||
|
||||
if (isset($Element['text']))
|
||||
{
|
||||
$text = $Element['text'];
|
||||
}
|
||||
// very strongly consider an alternative if you're writing an
|
||||
// extension
|
||||
elseif (isset($Element['rawHtml']))
|
||||
{
|
||||
$text = $Element['rawHtml'];
|
||||
$allowRawHtmlInSafeMode = isset($Element['allowRawHtmlInSafeMode']) && $Element['allowRawHtmlInSafeMode'];
|
||||
$permitRawHtml = !$this->safeMode || $allowRawHtmlInSafeMode;
|
||||
}
|
||||
|
||||
if (isset($text))
|
||||
{
|
||||
$markup .= '>';
|
||||
|
||||
if (!isset($Element['nonNestables']))
|
||||
if (!isset($Element['nonNestables']))
|
||||
{
|
||||
$Element['nonNestables'] = array();
|
||||
}
|
||||
|
||||
if (isset($Element['handler']))
|
||||
{
|
||||
$markup .= $this->{$Element['handler']}($Element['text'], $Element['nonNestables']);
|
||||
$markup .= $this->{$Element['handler']}($text, $Element['nonNestables']);
|
||||
}
|
||||
elseif (!$permitRawHtml)
|
||||
{
|
||||
$markup .= self::escape($text, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$markup .= self::escape($Element['text'], true);
|
||||
$markup .= $text;
|
||||
}
|
||||
|
||||
$markup .= '</'.$Element['name'].'>';
|
||||
|
@ -154,7 +154,7 @@ class Images
|
||||
$img_array = json_decode($sakura_image_array, true);
|
||||
$img = array_rand($img_array);
|
||||
$img_domain = akina_option('cover_cdn') ? akina_option('cover_cdn') : get_template_directory_uri();
|
||||
if (strpos($_SERVER['HTTP_ACCEPT'], 'image/webp')) {
|
||||
if (strpos($_SERVER['HTTP_ACCEPT'], 'image/webp') !== false) {
|
||||
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["webp"][0];
|
||||
} else {
|
||||
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["jpeg"][0];
|
||||
|
@ -146,7 +146,7 @@ function code_highlight_style() {
|
||||
}
|
||||
var ele_name = $('pre:eq(' + i + ')')[0].children[0].className;
|
||||
var lang = ele_name.substr(0, ele_name.indexOf(" ")).replace('language-', '');
|
||||
if (lang.toLowerCase() == "hljs") var lang = "text";
|
||||
if (lang.toLowerCase() == "hljs") var lang = $('pre:eq(' + i + ') code').attr("class").replace('hljs', '')?$('pre:eq(' + i + ') code').attr("class").replace('hljs', ''):"text";
|
||||
$('pre:eq(' + i + ')').addClass('highlight-wrap');
|
||||
for (var t in attributes) {
|
||||
$('pre:eq(' + i + ')').attr(t, attributes[t]);
|
||||
|
Loading…
Reference in New Issue
Block a user