Initial commit as of 2018-10-16
This commit is contained in:
22
assets/js/formats/bold.js
Normal file
22
assets/js/formats/bold.js
Normal file
@@ -0,0 +1,22 @@
|
||||
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;
|
Reference in New Issue
Block a user