3

出于某种原因,CKEditor 默认情况下不允许在小部件中输入。有人提到您可以将其添加到,dtd.$editables但快速测试表明它对我来说不可编辑,因此我正在尝试使用推荐的divs.

问题是我想要占位符,在具有纯 css 的现代浏览器中将占位符添加到 div 不是问题。与主编辑器一样,问题在于 CKEditor 鄙视空的可编辑项 - 它<br>在完全空的可编辑项上添加 a ,从而停止显示占位符。编辑然后删除内容时,它会添加 unicode 字符以表示虚无 - &#8203;

问题:如何让 CKEditor 将空的可编辑视为.. 空,而不是插入随机的<br>or &#8203;

editables: {
    // This one is rich, allowing italic and bold
    caption: {
        selector: '.image-caption',
        allowedContent: 'strong em',
        //disallowedContent: 'br' // Doesnt work
    },
    // And this one is pretending to be a plaintext input
    alt: {
        selector: '.image-alt',
        allowedContent: true
    }
}

谢谢。

4

0 回答 0