How to use the tiptap-utils.getMarkAttrs 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 scrumpy / tiptap / packages / tiptap-extensions / src / marks / Link.js View on Github external
handleClick: (view, pos, event) => {
            const { schema } = view.state
            const attrs = getMarkAttrs(view.state, schema.marks.link)

            if (attrs.href && event.target instanceof HTMLAnchorElement) {
              event.stopPropagation()
              window.open(attrs.href)
            }
          },
        },
github scrumpy / tiptap / packages / _legacy-tiptap / src / utils / buildMenuActions.js View on Github external
.map(([name]) => {
			const active = () => markIsActive(state, schema.marks[name])
			const attrs = getMarkAttrs(state, schema.marks[name])
			const command = commands[name] ? commands[name] : () => {}
			return {
				name,
				active,
				attrs,
				command,
			}
		})
		.reduce((actions, {
github scrumpy / tiptap / packages / tiptap / src / Editor.js View on Github external
.reduce((marks, [name, mark]) => ({
        ...marks,
        [name]: getMarkAttrs(this.state, mark),
      }), {})

tiptap-utils

Utility functions for tiptap

MIT
Latest version published 3 years ago

Package Health Score

71 / 100
Full package analysis

Similar packages