66import Vue from 'vue'
77import store from './store/index.js'
88import { subscribe } from '@nextcloud/event-bus'
9- import { EDITOR_UPLOAD , HOOK_MENTION_SEARCH , HOOK_MENTION_INSERT , ATTACHMENT_RESOLVER } from './components/Editor.provider.js'
9+ import { EDITOR_UPLOAD , HOOK_MENTION_SEARCH , HOOK_MENTION_INSERT , ATTACHMENT_RESOLVER , OPEN_LINK_HANDLER } from './components/Editor.provider.js'
1010import { ACTION_ATTACHMENT_PROMPT } from './components/Editor/MediaHandler.provider.js'
11+ import { openLink } from './helpers/links.js'
1112// eslint-disable-next-line import/no-unresolved, n/no-missing-import
1213import 'vite/modulepreload-polyfill'
1314
@@ -184,6 +185,7 @@ window.OCA.Text.createEditor = async function({
184185 onFileInsert = undefined ,
185186 onMentionSearch = undefined ,
186187 onMentionInsert = undefined ,
188+ openLinkHandler = undefined ,
187189 onSearch = undefined ,
188190} ) {
189191 const { default : MarkdownContentEditor } = await import ( /* webpackChunkName: "editor" */ './components/Editor/MarkdownContentEditor.vue' )
@@ -205,6 +207,9 @@ window.OCA.Text.createEditor = async function({
205207 [ EDITOR_UPLOAD ] : ! ! sessionEditor ,
206208 [ HOOK_MENTION_SEARCH ] : sessionEditor ? true : onMentionSearch ,
207209 [ HOOK_MENTION_INSERT ] : sessionEditor ? true : onMentionInsert ,
210+ [ OPEN_LINK_HANDLER ] : {
211+ openLink : openLinkHandler || openLink ,
212+ } ,
208213 [ ATTACHMENT_RESOLVER ] : {
209214 resolve ( src , preferRaw ) {
210215 return [ {
0 commit comments