由于某种原因,CKEditor默认情况下不允许在小部件中输入 . 有人提到你可以将它添加到 dtd.$editables ,但快速测试表明它不适合我,所以我试图使用推荐的 divs .

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

问题:如何使CKEditor将空可编辑视为空?而不是插入随机 <br>&#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
    }
}

谢谢 .