We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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:
defaultBlockSpecs.image.config.propSchema.textAlignment = { default: 'center', values: ['left', 'center', 'right', 'justify'], };
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.
The text was updated successfully, but these errors were encountered:
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; }
Sorry, something went wrong.
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: