diff --git a/cypress/component/richtext.cy.ts b/cypress/component/richtext.cy.ts index 90366e58f7..3fc75d9a9d 100644 --- a/cypress/component/richtext.cy.ts +++ b/cypress/component/richtext.cy.ts @@ -10,7 +10,7 @@ import { mount } from 'cypress/vue2' import NcRichText from '../../src/components/NcRichText/NcRichText.vue' describe('NcRichText', () => { - describe.only('XML-like text (escaped and unescaped)', () => { + describe('XML-like text (escaped and unescaped)', () => { const TEST = 'text <span>text</span>' it('renders normal text as passed', () => { mount(NcRichText, { diff --git a/src/components/NcRichText/NcRichText.vue b/src/components/NcRichText/NcRichText.vue index 5cceca82dd..39491c9c42 100644 --- a/src/components/NcRichText/NcRichText.vue +++ b/src/components/NcRichText/NcRichText.vue @@ -555,7 +555,9 @@ export default { }) .processSync(this.text // escape special symbol "<" to not treat text as HTML - .replace(/<[^>]+>/g, (match) => match.replace(/]+>/g, (match) => match.replace(/" to parse blockquotes + .replace(/>/gmi, '>'), ) .result diff --git a/src/components/NcRichText/remarkUnescape.js b/src/components/NcRichText/remarkUnescape.js index 470662d2b4..cc8ed8d77a 100644 --- a/src/components/NcRichText/remarkUnescape.js +++ b/src/components/NcRichText/remarkUnescape.js @@ -7,7 +7,7 @@ import { visit, SKIP } from 'unist-util-visit' export const remarkUnescape = function() { return function(tree) { - visit(tree, (node) => node.type === 'text' || node.type === 'code', + visit(tree, (node) => ['text', 'code', 'inlineCode'].includes(node.type), (node, index, parent) => { parent.children.splice(index, 1, { ...node,