How to use the @accordproject/markdown-html.HtmlTransformer function in @accordproject/markdown-html

To help you get started, we’ve selected a few @accordproject/markdown-html 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 accordproject / markdown-editor / src / SlateAsInputEditor / index.js View on Github external
const onPaste = (event, editor, next) => {
    if (!isEditable(editor, 'paste')) {
      return false;
    }
    if (isEditable(editor, 'paste')) {
      event.preventDefault();
      const transfer = getEventTransfer(event);
      if (transfer.type === 'html') {
        const htmlTransformer = new HtmlTransformer();
        const slateTransformer = new SlateTransformer();
        // @ts-ignore
        const ciceroMark = htmlTransformer.toCiceroMark(transfer.html, 'json');
        const { document } = slateTransformer.fromCiceroMark(ciceroMark);
        editor.insertFragment(document);
        return;
      }
    }
    return next();
  };

@accordproject/markdown-html

Transform CiceroDOM to HTML

Apache-2.0
Latest version published 25 days ago

Package Health Score

73 / 100
Full package analysis

Popular @accordproject/markdown-html functions