MCPcopy Create free account
hub / github.com/docusealco/docuseal / handleTextInput

Function handleTextInput

app/javascript/template_builder/dynamic_editor.js:573–588  ·  view source on GitHub ↗
(view, from, to, text)

Source from the content-addressed store, hash-verified

571 return this.getState(state)
572 },
573 handleTextInput (view, from, to, text) {
574 if (text !== '[') return false
575
576 const { state } = view
577 const charBefore = state.doc.textBetween(Math.max(from - 1, 0), from)
578
579 if (charBefore !== '[') return false
580
581 const tr = state.tr.insertText('[]]', from, to)
582
583 tr.setSelection(state.selection.constructor.create(tr.doc, from + 1))
584
585 view.dispatch(tr)
586
587 return true
588 }
589 }
590 })
591 ]

Callers

nothing calls this directly

Calls 1

createMethod · 0.45

Tested by

no test coverage detected