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/formats/font.js

19 lines
443 B
JavaScript
Raw Normal View History

2018-10-16 16:28:42 +00:00
import Parchment from 'parchment';
let config = {
scope: Parchment.Scope.INLINE,
whitelist: ['serif', 'monospace']
};
let FontClass = new Parchment.Attributor.Class('font', 'ql-font', config);
class FontStyleAttributor extends Parchment.Attributor.Style {
value(node) {
return super.value(node).replace(/["']/g, '');
}
}
let FontStyle = new FontStyleAttributor('font', 'font-family', config);
export { FontStyle, FontClass };