Commit 5e874143 authored by Liang Ding's avatar Liang Ding

代码高亮使用单独的 CSS 类

parent 3a3b812a
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* *
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a> * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.3.5, Oct 26, 2013 * @version 1.1.3.5, Jul 23, 2014
*/ */
var Page = function(tips) { var Page = function(tips) {
this.currentCommentId = ""; this.currentCommentId = "";
...@@ -294,7 +294,7 @@ $.extend(Page.prototype, { ...@@ -294,7 +294,7 @@ $.extend(Page.prototype, {
// get brush settings // get brush settings
var languages = [], var languages = [],
isScrip = false; isScrip = false;
$(".article-body pre").each(function() { $(".article-body pre, .code-highlight pre").each(function() {
var name = this.className.split(";")[0]; var name = this.className.split(";")[0];
var language = name.substr(7, name.length - 1); var language = name.substr(7, name.length - 1);
if (this.className.indexOf("html-script: true") > -1 && if (this.className.indexOf("html-script: true") > -1 &&
...@@ -329,7 +329,7 @@ $.extend(Page.prototype, { ...@@ -329,7 +329,7 @@ $.extend(Page.prototype, {
parseLanguage: function(obj) { parseLanguage: function(obj) {
var isPrettify = false, var isPrettify = false,
isSH = false; isSH = false;
$(".article-body pre").each(function() { $(".article-body pre, .code-highlight pre").each(function() {
if (this.className.indexOf("brush") > -1) { if (this.className.indexOf("brush") > -1) {
isSH = true; isSH = true;
} }
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment