Sjo*_*alk 6 html javascript ace-editor
我们在这里要求用户定义html,所以添加一个div或一个部分或类似的东西.所以,我在编辑HTML时需要验证工具提示.但是不想有doc-type警告.
小智 10
试试这个
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);
}
}
if(len>annotations.length) {
session.setAnnotations(annotations);
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1042 次 |
| 最近记录: |