提交 4e7b6ebb 编写于 作者: L luqiong

Merge remote-tracking branch 'origin/dev-1.2.5' into dev-1.2.5

......@@ -70,7 +70,7 @@ var htmlparser = UE.htmlparser = function (htmlstr) {
if (htmlattr) {
var attrs = {}, match;
while (match = re_attr.exec(htmlattr)) {
attrs[match[1].toLowerCase()] = match[2]
attrs[match[1].toLowerCase()] = match[2] || match[3] || match[4]
}
elm.attrs = attrs;
}
......
......@@ -31,9 +31,19 @@ test( '补全不完整table', function() {
equals(root.toHtml(),'<table><tbody><tr><td></td><td></td></tr></tbody></table>','包含\n,补全table');
});
test( '补全不完整li', function() {
var root = UE.htmlparser('<ol><li><em><u>sdf<li>sdfsdf</ol>');
equals(root.toHtml().replace(/[ ]+>/g,'>'),'<ol><li><em><u>sdf</u></em></li><li>sdfsdf</li></ol>','补全u,em');
root = UE.htmlparser('<ol><li><em>sdf</em></li><ul><li>a</li><li>b</li><li>c</ul><li>jkl</ol>');
equals(root.toHtml().replace(/[ ]+>/g,'>'),'<ol><li><em>sdf</em></li><ul><li>a</li><li>b</li><li>c</li></ul><li>jkl</li></ol>','补全li');
});
test( '属性引号问题', function() {
var root = UE.htmlparser('<img width=200 height=200 />');
equals(root.toHtml().replace(/[ ]+>/g,'>'),'<img width="200" height="200" />');
var root = UE.htmlparser("<img width='200' height='200' />");
equals(root.toHtml().replace(/[ ]+>/g,'>'),'<img width="200" height="200" />');
var root = UE.htmlparser('<img width="200" height="200" />');
equals(root.toHtml().replace(/[ ]+>/g,'>'),'<img width="200" height="200" />');
});
\ No newline at end of file
......@@ -19,8 +19,8 @@
var domUtils = baidu.editor.dom.domUtils;
var div_dom = document.body.appendChild( document.createElement( 'div' ) );
div_dom.id = 'test';
stop();
setTimeout(function(){
// stop();
// setTimeout(function(){
te.dom.push( div );
te.dom.push( iframe );
te.dom.push( div_dom);
......@@ -28,7 +28,7 @@
te.obj.push( editor );
te.obj.push( range );
te.obj.push( domUtils );
},50);
// },50);
}
var s = QUnit.testStart;
......
......@@ -125,12 +125,16 @@
}
try {
setTimeout(function() {
callback.call(testEnvironment);
if (config.stopCount == 1) {
if (config.stopCount == 1) {
setTimeout(function() {
callback.call(testEnvironment);
start();
}
}, 100);
}, 80);
}
else{
callback.call(testEnvironment);
}
} catch(e) {
fail("Test " + name + " died, exception and test follows", e, callback);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册