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
I want to replace tag with wich has inline style 'font-weight: 700;'
Is it possible?
My workaround is here, but it does not work on iphone(when use mobile formatting)
class CustomBold extends Inline { static blotName = 'bold'; static tagName = 'SPAN'; static create(value: string) { const node = super.create(value) as HTMLSpanElement; node.style.fontWeight = '700'; return node; } static formats(domNode: HTMLSpanElement) { return domNode.style.fontWeight === '700' ? true : false; } format(name: string, value: boolean) { if (name === 'bold') { this.domNode.style.fontWeight = value ? '700' : '400'; } else { super.format(name, value); } } formats() { let formats = super.formats(); formats['bold'] = CustomBold.formats(this.domNode); return formats; } }
The text was updated successfully, but these errors were encountered:
const { parchment } = Quill.imports const { StyleAttributor, Scope } = parchment class CustomBoldAttributor extends StyleAttributor{ constructor(){ return super( 'bold' , 'bold' ,{ scope: Scope.INLINE, }) } value( node ){ return node.style.fontWeight } add( node , value ){ node.style.fontWeight = value ? "bold" : "" return true } remove( node ){ node.style.fontWeight = "" } } //local registry const registry = new parchment.Registry registry.register( new CustomBoldAttributor , true ) //global registry Quill.register( new CustomBoldAttributor , true )
may work
Sorry, something went wrong.
No branches or pull requests
I want to replace tag with wich has inline style 'font-weight: 700;'
Is it possible?
My workaround is here, but it does not work on iphone(when use mobile formatting)
The text was updated successfully, but these errors were encountered: