Skip to content

Commit

Permalink
Merge pull request #6372 from nextcloud-libraries/fix/NcRichContented…
Browse files Browse the repository at this point in the history
…itable--remove-linkify

fix(NcRichContenteditable): remove value linkify
  • Loading branch information
Antreesy authored Feb 13, 2025
2 parents 8a28f4d + 29f0f7e commit 654f398
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
4 changes: 1 addition & 3 deletions src/mixins/richEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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 "
Expand Down
11 changes: 0 additions & 11 deletions tests/unit/mixins/richEditor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@ describe('richEditor.js', () => {
expect(parsedOutput).toEqual(input)
})

it('no duplicated ampersand (from Linkify)', () => {
const editor = shallowMount(TestEditor, { propsData: { 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, { propsData: { userData: {} } })
const input = 'hello @foobar'
Expand Down

0 comments on commit 654f398

Please sign in to comment.