Open lamtuanamc opened 1 month ago
This should work:
editor.schema.blockSchema.image.propSchema.textAlignment.default =
"center" as any;
editor.schema.blockSpecs.image.config.propSchema.textAlignment.default =
"center" as any;
Also make sure to add this CSS:
.bn-block-content[data-content-type="image"]:not([data-text-alignment]) {
justify-content: center;
text-align: center;
}
doesnt work with editor.blocksToHTMLLossy
When inserting an image block, I want to set the caption text alignment to "center" by default.
In the previous version of BlockNote (0.14.x), I was able to do this with the following code:
However, in newest version, I can't seem to set it this way anymore, as the default value is now 'left', and it's no longer a string type.