UNPKG

410 BJavaScriptView Raw
1import Inline from '../blots/inline';
2
3class Bold extends Inline {
4 static create() {
5 return super.create();
6 }
7
8 static formats() {
9 return true;
10 }
11
12 optimize(context) {
13 super.optimize(context);
14 if (this.domNode.tagName !== this.statics.tagName[0]) {
15 this.replaceWith(this.statics.blotName);
16 }
17 }
18}
19Bold.blotName = 'bold';
20Bold.tagName = ['STRONG', 'B'];
21
22export default Bold;