diff --git a/cypress/e2e/nodes/Links.spec.js b/cypress/e2e/nodes/Links.spec.js index 2e3906c0a49..ab6c056b89b 100644 --- a/cypress/e2e/nodes/Links.spec.js +++ b/cypress/e2e/nodes/Links.spec.js @@ -116,6 +116,30 @@ describe('test link marks', function() { .should('have.been.calledWith', link) }) + it('Handles typed in markdown links with text', () => { + const link = 'https://nextcloud.com/' + cy.insertLine(`[text](${link})`) + clickLink(link) + cy.get('.link-view-bubble .widget-default', { timeout: 10000 }) + .find('.widget-default--name') + .contains('Nextcloud') + cy.get('.link-view-bubble a') + .should('have.attr', 'href', link) + }) + + it('Leaves out link to other protocols', () => { + const link = 'other://protocol' + cy.insertLine(`[text](${link})`) + cy.getContent() + .find(`a[href*="${link}"]`) + .should('not.exist') + clickLink('#') + cy.get('.link-view-bubble__title', { timeout: 10000 }) + .contains('other://protocol') + cy.get('.link-view-bubble a') + .should('not.exist') + }) + }) describe('autolink', function() { diff --git a/src/components/Link/LinkBubbleView.vue b/src/components/Link/LinkBubbleView.vue index 3a991ae4184..ed5bd188b39 100644 --- a/src/components/Link/LinkBubbleView.vue +++ b/src/components/Link/LinkBubbleView.vue @@ -74,7 +74,7 @@ -