Archived
1
0
This repository has been archived on 2020-12-10. You can view files and clone it, but cannot push or open issues or pull requests.
old/assets/js/blots/break.js
2018-10-16 18:28:42 +02:00

30 lines
408 B
JavaScript

import Parchment from 'parchment';
class Break extends Parchment.Embed {
static value() {
return undefined;
}
insertInto(parent, ref) {
if (parent.children.length === 0) {
super.insertInto(parent, ref);
} else {
this.remove();
}
}
length() {
return 0;
}
value() {
return '';
}
}
Break.blotName = 'break';
Break.tagName = 'BR';
export default Break;