diff --git a/src/plugins/currentLineMenu.js b/src/plugins/currentLineMenu.js index 65cf1d61857..f89daa93b5c 100644 --- a/src/plugins/currentLineMenu.js +++ b/src/plugins/currentLineMenu.js @@ -157,12 +157,12 @@ function menuForCurrentParagraph(editor) { const { selection } = editor.state const { textContent } = selection.$anchor.parent const eol = selection.$anchor.end() - const contentToInsert = textContent.match(/(^| )$/) ? '/' : ' /' - editor.chain() - .focus() - .setTextSelection(eol) - .insertContent(contentToInsert) - .run() + const chain = editor.chain().focus().setTextSelection(eol) + if (textContent.trim() === '') { + chain.insertContent('/').run() + } else { + chain.splitBlock().insertContent('/').run() + } }) return menu.$el } diff --git a/vite.config.ts b/vite.config.ts index 0a568b1a2f9..32fa1376c20 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -77,6 +77,9 @@ const config = createAppConfig({ } }, }, + server: { + allowedHosts: ['host.docker.internal', 'localhost', 'nextcloud.local'], + }, }, })