Add hljs class manually

This commit is contained in:
Rodrigo Fernandes 2016-05-09 18:21:50 +01:00
parent 73999bb782
commit 93721e7e98
No known key found for this signature in database
GPG key ID: 08E3C5F38969078E

View file

@ -109,13 +109,9 @@
result.value = mergeStreams(originalStream, nodeStream(resultNode), text); result.value = mergeStreams(originalStream, nodeStream(resultNode), text);
} }
buildClassName(line.className, result.language) $line.addClass("hljs");
.split(" ") $line.addClass(result.language);
.map(function(className) {
$line.addClass(className);
});
$line.html(result.value); $line.html(result.value);
}); });
}); });
}; };
@ -207,20 +203,6 @@
* Will be removed when this part of the API is exposed * 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 */ /* Utility functions */
function escape(value) { function escape(value) {