bug in highlight.js: function maj_highlight
Brought to you by:
cdolivet
the maj_highlight function will crash sometime at this line:
trace_new = t.get_syntax_trace(changes.newTextLine).replace(/\r/g, '');
the get_syntax_trace function will return undefined value sometime.
solution:
change the code
// return identication that allow to know if revalidating only the text line won't make the syntax go mad
EditArea.prototype.get_syntax_trace= function(text){
if(this.settings["syntax"].length>0 && parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"])
return text.replace(parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"], "$3");
};
to
// return identication that allow to know if revalidating only the text line won't make the syntax go mad
EditArea.prototype.get_syntax_trace= function(text){
if(this.settings["syntax"].length>0 && parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"])
return text.replace(parent.editAreaLoader.syntax[this.settings["syntax"]]["syntax_trace_regexp"], "$3");
return " ";
};