From c3f9dfdb7d3defe797bf354f8595011e2e12caff Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Mon, 13 Jan 2025 20:47:40 +0100 Subject: [PATCH] fix(NcRichContenteditable): remove value linkify Signed-off-by: Grigorii K. Shartsev --- src/mixins/richEditor/index.js | 4 +--- tests/unit/mixins/richEditor.spec.js | 11 ----------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/mixins/richEditor/index.js b/src/mixins/richEditor/index.js index 4381e84684..441d90f571 100644 --- a/src/mixins/richEditor/index.js +++ b/src/mixins/richEditor/index.js @@ -4,7 +4,6 @@ */ import NcMentionBubble from '../../components/NcRichContenteditable/NcMentionBubble.vue' -import Linkify from '../../utils/Linkify.js' import escapeHtml from 'escape-html' import stripTags from 'striptags' @@ -51,8 +50,7 @@ export default { // When splitting, the string is always putting the userIds // on the uneven indexes. We only want to generate the mentions html if (!part.startsWith('@')) { - // This part doesn't contain a mention, let's make sure links are parsed - return Linkify(part) + return part } // Extracting the id, nuking the leading @ and all " diff --git a/tests/unit/mixins/richEditor.spec.js b/tests/unit/mixins/richEditor.spec.js index a60def1873..5c3c727322 100644 --- a/tests/unit/mixins/richEditor.spec.js +++ b/tests/unit/mixins/richEditor.spec.js @@ -37,17 +37,6 @@ describe('richEditor.js', () => { expect(parsedOutput).toEqual(input) }) - it('no duplicated ampersand (from Linkify)', () => { - const editor = shallowMount(TestEditor, { props: { userData: {} } }) - const input = 'hello &' - const output = editor.vm.renderContent(input) - - expect(output).toEqual('hello &') - - const parsedOutput = editor.vm.parseContent(output) - expect(parsedOutput).toEqual(input) - }) - it('keeps mentions without user data', () => { const editor = shallowMount(TestEditor, { props: { userData: {} } }) const input = 'hello @foobar'