Add hljs class manually
This commit is contained in:
parent
73999bb782
commit
93721e7e98
1 changed files with 2 additions and 20 deletions
|
|
@ -109,13 +109,9 @@
|
|||
result.value = mergeStreams(originalStream, nodeStream(resultNode), text);
|
||||
}
|
||||
|
||||
buildClassName(line.className, result.language)
|
||||
.split(" ")
|
||||
.map(function(className) {
|
||||
$line.addClass(className);
|
||||
});
|
||||
$line.addClass("hljs");
|
||||
$line.addClass(result.language);
|
||||
$line.html(result.value);
|
||||
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
@ -207,20 +203,6 @@
|
|||
* Will be removed when this part of the API is exposed
|
||||
*/
|
||||
|
||||
function buildClassName(prevClassName, language) {
|
||||
var result = [prevClassName.trim()];
|
||||
|
||||
if (!prevClassName.match(/\bhljs\b/)) {
|
||||
result.push('hljs');
|
||||
}
|
||||
|
||||
if (prevClassName.indexOf(language) === -1) {
|
||||
result.push(language);
|
||||
}
|
||||
|
||||
return result.join(' ').trim();
|
||||
}
|
||||
|
||||
/* Utility functions */
|
||||
|
||||
function escape(value) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue