font.js 443 B

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