CKEditor的白名单插件将清理规则添加到 dataProcessor 的 dataFilter 和 htmlFilter。如果某个元素不在白名单中,则将其连同所有子节点一起删除:
// console.log("Remove " + element.name);
// The element (as well as any content or children) is removed.
return false;
但是,我想保留任何内容/孩子。基本上,我想要这样:
This is <u>really</u> important!
变成这样:
This is really important!
不是这个:
This is important!