How to use the parchment.register function in parchment

To help you get started, we’ve selected a few parchment examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webiny / Webiny / Js / Webiny / Assets / node_modules / quill / core / quill.js View on Github external
if (typeof name === 'string') {
        // register(Blot | Attributor, overwrite)
        this.register('formats/' + name, path, target);
      } else {
        Object.keys(path).forEach((key) => {
          this.register(key, path[key], target);
        });
      }
    } else {
      if (this.imports[path] != null && !overwrite) {
        debug.warn(`Overwriting ${path} with`, target);
      }
      this.imports[path] = target;
      if ((path.startsWith('blots/') || path.startsWith('formats/')) &&
          target.blotName !== 'abstract') {
        Parchment.register(target);
      }
    }
  }
github twofactor / MenubarNotes / node_modules / quill / core / quill.js View on Github external
if (typeof name === 'string') {
        // register(Blot | Attributor, overwrite)
        this.register('formats/' + name, path, target);
      } else {
        Object.keys(path).forEach((key) => {
          this.register(key, path[key], target);
        });
      }
    } else {
      if (this.imports[path] != null && !overwrite) {
        debug.warn(`Overwriting ${path} with`, target);
      }
      this.imports[path] = target;
      if ((path.startsWith('blots/') || path.startsWith('formats/')) &&
          target.blotName !== 'abstract') {
        Parchment.register(target);
      }
    }
  }
github quilljs / quill / core.js View on Github external
'blots/block'        : Block,
  'blots/block/embed'  : BlockEmbed,
  'blots/break'        : Break,
  'blots/container'    : Container,
  'blots/cursor'       : Cursor,
  'blots/embed'        : Embed,
  'blots/inline'       : Inline,
  'blots/scroll'       : Scroll,
  'blots/text'         : TextBlot,

  'modules/clipboard'  : Clipboard,
  'modules/history'    : History,
  'modules/keyboard'   : Keyboard
});

Parchment.register(Block, Break, Cursor, Inline, Scroll, TextBlot);


export default Quill;
github dost / quilljs-table / quilljs-source-code / core.js View on Github external
'blots/block'        : Block,
  'blots/block/embed'  : BlockEmbed,
  'blots/break'        : Break,
  'blots/container'    : Container,
  'blots/cursor'       : Cursor,
  'blots/embed'        : Embed,
  'blots/inline'       : Inline,
  'blots/scroll'       : Scroll,
  'blots/text'         : TextBlot,

  'modules/clipboard'     : Clipboard,
  'modules/history'       : History,
  'modules/keyboard'      : Keyboard,
});

Parchment.register(Block, Break, Cursor, Inline, Scroll, TextBlot);


module.exports = Quill;
github quilljs / quill / src / formats / block.js View on Github external
super.add(node, value);
    }
  }
}

let Align = new BlockAttributor('align', 'text-align', {
  default: 'left',
  whitelist: ['left', 'right', 'center', 'justify']
});

let Direction = new BlockAttributor('direction', 'direction', {
  default: 'ltr',
  whitelist: ['ltr', 'rtl']
});

Parchment.register(Align);
Parchment.register(Direction);

export { Align, Direction, BlockAttributor };
github quilljs / quill / src / formats / block.js View on Github external
}
  }
}

let Align = new BlockAttributor('align', 'text-align', {
  default: 'left',
  whitelist: ['left', 'right', 'center', 'justify']
});

let Direction = new BlockAttributor('direction', 'direction', {
  default: 'ltr',
  whitelist: ['ltr', 'rtl']
});

Parchment.register(Align);
Parchment.register(Direction);

export { Align, Direction, BlockAttributor };