You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to overwrite the basic block function of the editor so that all of the elements created by the user are created as styled spans.
i am overwriting the block blot with the following:
// Custom Paragraph Blot (Replaces <p>)
class CustomParagraph extends Block {
static create() {
let node = super.create();
node.setAttribute('data-type', 'p'); // Replace <p> with <span data-type="p">
return node;
}
}
CustomParagraph.blotName = 'block';
CustomParagraph.tagName = 'span'; // Use <span> instead of <p>
Quill.register(CustomParagraph, true); // Overwrite default
but when I type and press return, instead of wrapping the text node in the span and adding the break element onto the end, it also wraps the break element in a span.
I am trying to overwrite the basic block function of the editor so that all of the elements created by the user are created as styled spans.
i am overwriting the block blot with the following:
but when I type and press return, instead of wrapping the text node in the span and adding the break element onto the end, it also wraps the break element in a span.
Should this be the case, or is there a better way to do this?
The text was updated successfully, but these errors were encountered: