embed
embed copied to clipboard
Disable caption
Nice plugin. Is there a way how to disable a caption? I do not want it in my editor. Thank you
You can do the following with css:
.embed-tool__caption {
display: none;
}
Hey @literakl, I don't know if you have already done that but we wanted to control if the caption should appear on read-only mode if it is empty and I found a solution that may be interesting for you. I extended the Embed class and removed the caption html element after calling the render method:
import Embed from '@editorjs/embed';
export default class CustomEditorJSEmbed extends Embed {
render() {
this.element = Embed.prototype.render.call(this);
if (this.readOnly && !this.data.caption) {
this.element.removeChild(this.element.lastChild);
}
return this.element;
}
}
Thanks, but I have switched away from editorjs.