Hey there,
im getting into prosemirror right now and im having a hard time since my js-knowledge is a bit rusty… Im got the Dino-Example (Link) running yesterday (yay ) and currently im trying to implement a very basic input-rule.
Therefore i used this code:
let plugins = exampleSetup({schema: this.dinoSchema, menuContent: menu.fullMenu});
let dinoInput = new InputRule(/---$/, "test");
plugins.push(inputRules({dinoInput}))
window.view = new EditorView(document.querySelector("#editor"), {
state: EditorState.create({
doc: startDoc,
// Pass exampleSetup our schema and the menu we created
plugins: plugins
})
})
When i run this im getting an error whenever i type something in the editor:
Uncaught TypeError: Cannot read property 'length' of undefined
at run (index.es.js?f95e:75)
at Plugin.handleTextInput (index.es.js?f95e:51)
at eval (index.es.js?576a:2654)
at EditorView.someProp (index.es.js?576a:4795)
at readDOMChange (index.es.js?576a:2654)
at DOMObserver.eval [as handleDOMChange] (index.es.js?576a:3238)
at DOMObserver.flush (index.es.js?576a:3155)
at MutationObserver.DOMObserver.observer (index.es.js?576a:3022)
Does anyone know what is going on here or what i can do to implement it the right way?
Sorry if im doing rookie-mistakes here