Closed rama291041610 closed 4 years ago
我也不知道为何会出现不同的情况……
我也碰到这个问题,解决方法如下 在highlight.js文件中的subMode函数中添加一个判断即可
function subMode(lexeme, mode) {
var i, length;
if(mode.contains){ //判断该属性是否存在
for (i = 0, length = mode.contains.length; i < length; i++) {
if (testRe(mode.contains[i].beginRe, lexeme)) {
if (mode.contains[i].endSameAsBegin) {
mode.contains[i].endRe = escapeRe( mode.contains[i].beginRe.exec(lexeme)[0] );
}
return mode.contains[i];
}
}
}
}
For BUG
For question
Sometimes when I execute “hexo s" or "hexo g", hexo will throw TypeError like above. Sometimes it can works without error. The same code but different results.
How can I solve the problem?
There is my code.
https://github.com/rama291041610/250.ac.cn