Verified Commit d5f9ecb1 authored by Camil Staps's avatar Camil Staps 🙂

Allow for null callback

parent c1301f87
......@@ -71,7 +71,7 @@ function highlightToHTML(lex, istr, callback, start) {
var cls = elems[i]['class'];
var str = elems[i]['str'];
var span = '<span class="' + cls + '">' + escapeHTML(str) + '</span>';
if (typeof callback != 'undefined') {
if (typeof callback == 'function') {
ostr += callback(span, cls, str);
} else {
ostr += span;
......@@ -94,11 +94,11 @@ function highlightFunction(func, callback, start) {
span.replace('class="' + cls + '"', 'class="macroargumentinrhs"'),
'macroargumentinrhs', str);
if (typeof callback != 'undefined')
if (typeof callback == 'function')
return callback(span, cls, str);
else
return span;
}
};
return highlightToHTML({
start: [
......
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