emit autocomplete text
This commit is contained in:
@@ -88,7 +88,13 @@ export default class ContextedLinkEditing extends Plugin {
|
||||
model.createRange(model.createPositionAt(block, 0), focus),
|
||||
model
|
||||
)
|
||||
console.log(text, range)
|
||||
const inputText = (text as string).split(']]').at(-1)
|
||||
const autocompleteOpenMatch = (inputText as string).match(/(?<=\[\[).+/g)
|
||||
const autocompleteCloseMatch = (inputText as string).match(/(?<=\[\[).+?(?=]])/g)
|
||||
const openAutocomplete = autocompleteOpenMatch && !autocompleteCloseMatch
|
||||
if (openAutocomplete) {
|
||||
editor.model.document.fire('contextedLinkAutocomplete', autocompleteOpenMatch)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user