Verified Commit 7a18f6a3 authored by Camil Staps's avatar Camil Staps 🚀

v0.1.16: don't crash when no callback is given

parent f2282f68
......@@ -618,19 +618,19 @@ function highlightClean(func, callback, start) {
indents = [[0, 'start']];
var myCallback = function(span, cls, str) {
if (cls == '__type__')
if (cls == '__type__') {
return highlightClean(str, callback);
else if (cls == '__reset__arguments__') {
} else if (cls == '__reset__arguments__') {
macroargs = [];
return callback(
span.replace('class="' + cls + '"', 'class="whitespace"'),
'whitespace', str);
} else if (cls == 'argument')
} else if (cls == 'argument') {
macroargs.push(str);
else if (macroargs.indexOf(str) >= 0)
return callback(
span.replace('class="' + cls + '"', 'class="argumentinrhs"'),
'argumentinrhs', str);
} else if (macroargs.indexOf(str) >= 0) {
span = span.replace('class="' + cls + '"', 'class="argumentinrhs"');
cls = 'argumentinrhs';
}
if (typeof callback == 'function')
return callback(span, cls, str);
......
{
"name": "clean-highlighter",
"version": "0.1.15",
"version": "0.1.16",
"description": "Clean language highlighter",
"keywords": ["clean","highlighter"],
"main": "clean.js",
......
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