mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-08 20:10:16 +08:00
23 lines
410 B
JavaScript
23 lines
410 B
JavaScript
|
|
import Inline from '../blots/inline';
|
||
|
|
|
||
|
|
class Bold extends Inline {
|
||
|
|
static create() {
|
||
|
|
return super.create();
|
||
|
|
}
|
||
|
|
|
||
|
|
static formats() {
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
optimize(context) {
|
||
|
|
super.optimize(context);
|
||
|
|
if (this.domNode.tagName !== this.statics.tagName[0]) {
|
||
|
|
this.replaceWith(this.statics.blotName);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
Bold.blotName = 'bold';
|
||
|
|
Bold.tagName = ['STRONG', 'B'];
|
||
|
|
|
||
|
|
export default Bold;
|