add full prism

This commit is contained in:
若海 2022-04-22 23:16:35 +08:00
parent 17d7b1dd66
commit 614bf0d98c
4 changed files with 316 additions and 9 deletions

View File

@ -71,7 +71,7 @@ class Prismjs_Plugin implements Typecho_Plugin_Interface
public static function header()
{
$cssUrl = Helper::options()->pluginUrl . '/Prismjs/src/prism.css';
echo '<link rel="stylesheet" type="text/css" href="' . $cssUrl . '?v2" />';
echo '<link rel="stylesheet" type="text/css" href="' . $cssUrl . '?v3" />';
}
/**
@ -84,7 +84,7 @@ class Prismjs_Plugin implements Typecho_Plugin_Interface
public static function footer()
{
$jsUrl = Helper::options()->pluginUrl . '/Prismjs/src/prism.js';
echo '<script type="text/javascript" src="' . $jsUrl . '?v2"></script>';
echo '<script type="text/javascript" src="' . $jsUrl . '?v3"></script>';
}
/**
@ -98,6 +98,7 @@ class Prismjs_Plugin implements Typecho_Plugin_Interface
$text = empty($lastResult) ? $text : $lastResult;
if ($widget instanceof Widget_Archive || $widget instanceof Widget_Abstract_Comments) {
$text = str_replace('<pre><code>', '<pre><code class="lang-auto">', $text);
$text = str_replace('lang-sh', 'lang-shell', $text);
}

View File

@ -0,0 +1 @@
# Prism 代码高亮插件

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long