Roo.htmleditor.FilterLongBr = function(cfg)
{
this.walk(cfg.node);
}
Roo.extend(Roo.htmleditor.FilterLongBr, Roo.htmleditor.Filter,
{
tag : 'BR',
replaceTag : function(node)
{
var ps = node.nextSibling;
while (ps && ps.nodeType == 3 && ps.nodeValue.trim().length < 1) {
ps = ps.nextSibling;
}
if (!ps && [ 'TD', 'TH', 'LI', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6' ].indexOf(node.parentNode.tagName) > -1) {
node.parentNode.removeChild(node); return false;
}
if (!ps || ps.nodeType != 1) {
return false;
}
if (!ps || ps.tagName != 'BR') {
return false;
}
if (!node.previousSibling) {
return false;
}
var ps = node.previousSibling;
while (ps && ps.nodeType == 3 && ps.nodeValue.trim().length < 1) {
ps = ps.previousSibling;
}
if (!ps || ps.nodeType != 1) {
return false;
}
if (!ps || [ 'BR', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6' ].indexOf(ps.tagName) < 0) {
return false;
}
node.parentNode.removeChild(node); return false; }
});