图像标题是“image”元素中的“caption”元素。看看这个片段:
editor.model.change(writer => {
const image = writer.createElement( 'image', { src: 'https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/assets/img/umbrellas.jpg' } );
writer.appendElement( 'caption', image );
writer.appendText( 'Caption text', image.getChild( 0 ) );
writer.append(image, editor.model.document.getRoot() );
});
执行它,它将附加一个带有标题的图像到编辑器中。
更重要的是,定义哪些属性可用于哪些元素类型以及元素的行为方式的文档在哪里?我只是从一个例子中了解了src属性。
目前尚无此类文件。要了解更多有关模型的信息,最简单的方法是浏览
*editing.js
档案
feature.