question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding different instances of a keyed plugin (MILKDOWN_PLUGIN_ID$)

See original GitHub issue

Describe the bug Use Configure Shortcuts

const nodes = commonmarkNodes.configure(heading, {
    keymap: {
        [SupportedKeys.H1]: 'Mod-1',
        [SupportedKeys.H2]: 'Mod-2',
        [SupportedKeys.H3]: 'Mod-3',
        [SupportedKeys.H4]: 'Mod-4',
        [SupportedKeys.H5]: 'Mod-5',
    },
});

const editor = Editor.make()
        .config((ctx) => {
            ctx.set(rootCtx, root);
            ctx.set(defaultValueCtx, defaultValue);
            ctx.set(editorViewOptionsCtx, { editable: () => !readOnly });
            if (onChange) {
                ctx.get(listenerCtx)
                    .markdownUpdated((_, markdown) => {
                        onChange(markdown);
                    })
                    .mounted(() => {
                        setEditorReady(true);
                    });
            }
        })
        .use(nord)
        .use(gfm)
        .use(listener)
        .use(clipboard)
        .use(history)
        .use(cursor)
        .use(prism)
        .use(diagram)
        .use(tooltip)
        .use(math)
        .use(indent)
        .use(upload)
        .use(slash)
        .use(nodes)
        .use(commonmarkPlugins);

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Saul-Mironecommented, Feb 6, 2022

请问下如何能够使用 gfm 的同时能够使用自定义的快捷键呢?

Editor.make()
// ...
.use(gfm.configure(blockquote, {
    keymap: {
        [SupportedKeys.Blockquote]: 'Mod-Shift-b',
        // or you may want to bind multiple keys:
        [SupportedKeys.Blockquote]: ['Mod-Shift-b', 'Mod-b'],
    },
}))
1reaction
hua1995116commented, Jan 23, 2022

好的,了解了。文档中貌似没有找到相关的描述, 3q ~

Read more comments on GitHub >

github_iconTop Results From Across the Web

RangeError: Adding different instances of a keyed plugin ...
I've updated tiptap from v1.8.0 to v1.19.0 and now I have this bug in the console : [Vue warn]: Error in data(): "RangeError:...
Read more >
RangeError: Adding different instances of a keyed plugin ...
I'm loading plugins dynamically using ES6 dynamic imports. My API entry is through tiptap v2. What I'm now noticing that whenever I add...
Read more >
TipTap / Grant Nestor - Observable
viewof editor = RangeError: Adding different instances of a keyed plugin (plugin$). RuntimeError: Adding different instances of a keyed plugin (plugin$).
Read more >
Editor raises a bunch of weird errors and does not render
I am trying to implement the very basic example: import { Editor } ... Uncaught RangeError: Adding different instances of a keyed plugin...
Read more >
RangeError: Adding different instances of a keyed plugin ...
Anything to add? (optional). 111 when I debug into it, seems plugin key duplicate to $6 and I simple trigger get will fix...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found