diff --git a/extensions/hyper-link/src/index.ts b/extensions/hyper-link/src/index.ts index 130aaf81f..c2c4ddb81 100644 --- a/extensions/hyper-link/src/index.ts +++ b/extensions/hyper-link/src/index.ts @@ -41,10 +41,10 @@ class HyperLinkIcon extends WidgetType { function hyperLinkDecorations(view: EditorView, anchor?: HyperLinkExtensionOptions['anchor']) { const widgets: Array> = []; - const doc = view.state.doc; + const doc = view.state.doc.toString(); let match; - while ((match = defaultRegexp.exec(doc.toString())) !== null) { + while ((match = defaultRegexp.exec(doc)) !== null) { const from = match.index; const to = from + match[0].length; const widget = Decoration.widget({