How to use the tiptap-utils.getMarkRange function in tiptap-utils

To help you get started, we’ve selected a few tiptap-utils 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 apostrophecms / apostrophe / lib / modules / apostrophe-rich-text-widgets / src / apos / tiptap-extensions / Link.js View on Github external
handleClick(view, pos) {
            const { schema, doc, tr } = view.state;
            const range = getMarkRange(doc.resolve(pos), schema.marks.link);

            if (!range) {
              return;
            }

            const $start = doc.resolve(range.from);
            const $end = doc.resolve(range.to);
            const transaction = tr.setSelection(new TextSelection($start, $end));

            view.dispatch(transaction);
          }
        }
github scrumpy / tiptap / packages / tiptap / src / Utils / ComponentView.js View on Github external
getMarkPos() {
    const pos = this.view.posAtDOM(this.dom)
    const resolvedPos = this.view.state.doc.resolve(pos)
    const range = getMarkRange(resolvedPos, this.node.type)
    return range
  }

tiptap-utils

Utility functions for tiptap

MIT
Latest version published 3 years ago

Package Health Score

71 / 100
Full package analysis

Similar packages