UNPKG

443 BJavaScriptView Raw
1import Parchment from 'parchment';
2
3let config = {
4 scope: Parchment.Scope.INLINE,
5 whitelist: ['serif', 'monospace']
6};
7
8let FontClass = new Parchment.Attributor.Class('font', 'ql-font', config);
9
10class FontStyleAttributor extends Parchment.Attributor.Style {
11 value(node) {
12 return super.value(node).replace(/["']/g, '');
13 }
14}
15
16let FontStyle = new FontStyleAttributor('font', 'font-family', config);
17
18export { FontStyle, FontClass };