mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 23:15:15 +08:00
parent
ff6e00a356
commit
a95ba3fa6f
@ -52,6 +52,15 @@ context('/src/Marks/Link/React/', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('should allow exiting the link once set', () => {
|
||||
cy.get('.tiptap').then(([{ editor }]) => {
|
||||
editor.commands.setContent('<p><a href="#" target="_self">Example Text2</a></p>')
|
||||
cy.get('.tiptap').type('{rightArrow}')
|
||||
|
||||
cy.get('button:first').should('not.have.class', 'is-active')
|
||||
})
|
||||
})
|
||||
|
||||
it('detects autolinking', () => {
|
||||
cy.get('.tiptap').type('https://example.com ').find('a').should('contain', 'https://example.com')
|
||||
.should('have.attr', 'href', 'https://example.com')
|
||||
|
@ -63,6 +63,15 @@ context('/src/Marks/Link/Vue/', () => {
|
||||
.should('have.attr', 'href', 'https://example2.com')
|
||||
})
|
||||
|
||||
it('should allow exiting the link once set', () => {
|
||||
cy.get('.tiptap').then(([{ editor }]) => {
|
||||
editor.commands.setContent('<p><a href="#" target="_self">Example Text2</a></p>')
|
||||
cy.get('.tiptap').type('{rightArrow}')
|
||||
|
||||
cy.get('button:first').should('not.have.class', 'is-active')
|
||||
})
|
||||
})
|
||||
|
||||
it('detects autolinking', () => {
|
||||
cy.get('.tiptap').type('https://example.com ').find('a').should('contain', 'https://example.com')
|
||||
.should('have.attr', 'href', 'https://example.com')
|
||||
|
@ -120,6 +120,8 @@ export const Link = Mark.create<LinkOptions>({
|
||||
|
||||
keepOnSplit: false,
|
||||
|
||||
exitable: true,
|
||||
|
||||
onCreate() {
|
||||
this.options.protocols.forEach(protocol => {
|
||||
if (typeof protocol === 'string') {
|
||||
|
Loading…
Reference in New Issue
Block a user