How to use @tiptap/extension-heading - 2 common examples

To help you get started, we’ve selected a few @tiptap/extension-heading 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 gitlabhq / gitlabhq / spec / frontend / content_editor / services / track_input_rules_and_shortcuts_spec.js View on Github external
it('sends a tracking event indicating that a heading was created using an input rule', async () => {
        const shortcuts = Heading.config.addKeyboardShortcuts.call(Heading);
        const [firstShortcut] = Object.keys(shortcuts);
        const nodeName = Heading.name;

        editor.chain().keyboardShortcut(firstShortcut).insertContent(HEADING_TEXT).run();

        expect(trackingSpy).toHaveBeenCalledWith(undefined, KEYBOARD_SHORTCUT_TRACKING_ACTION, {
          label: CONTENT_EDITOR_TRACKING_LABEL,
          property: `${nodeName}.${firstShortcut}`,
        });
      });
    });
github gitlabhq / gitlabhq / spec / frontend / content_editor / services / track_input_rules_and_shortcuts_spec.js View on Github external
it('sends a tracking event indicating that a heading was created using an input rule', async () => {
        const shortcuts = Heading.config.addKeyboardShortcuts.call(Heading);
        const [firstShortcut] = Object.keys(shortcuts);
        const nodeName = Heading.name;

        editor.chain().keyboardShortcut(firstShortcut).insertContent(HEADING_TEXT).run();

        expect(trackingSpy).toHaveBeenCalledWith(undefined, KEYBOARD_SHORTCUT_TRACKING_ACTION, {
          label: CONTENT_EDITOR_TRACKING_LABEL,
          property: `${nodeName}.${firstShortcut}`,
        });
      });
    });

@tiptap/extension-heading

heading extension for tiptap

MIT
Latest version published 6 days ago

Package Health Score

95 / 100
Full package analysis