With "Unexpected file completion. Expected DOCTYPE." warning filtered.
var session = editor.getSession(); session.on("changeAnnotation", function () { var annotations = session.getAnnotations() || [], i = len = annotations.length; while (i--) { if (/doctype first\. Expected/.test(annotations[i].text)) { annotations.splice(i, 1); } else if (/Unexpected End of file\. Expected/.test(annotations[i].text)) { annotations.splice(i, 1); } } if (len > annotations.length) { session.setAnnotations(annotations); } });
source share