mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-30 17:09:02 +08:00
refactor: update tests url checking logic and comments
This commit is contained in:
parent
6bdb5917a5
commit
035862b698
@ -136,7 +136,7 @@ context('/src/Marks/Link/React/', () => {
|
|||||||
disallowedProtocols.forEach(url => {
|
disallowedProtocols.forEach(url => {
|
||||||
cy.get('.tiptap').then(([{ editor }]) => {
|
cy.get('.tiptap').then(([{ editor }]) => {
|
||||||
editor.commands.setContent(`<p><a href="${url}">Example Text</a></p>`)
|
editor.commands.setContent(`<p><a href="${url}">Example Text</a></p>`)
|
||||||
expect(editor.getHTML()).to.not.include(`<a href="${url}">`)
|
expect(editor.getHTML()).to.not.include(url)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -147,7 +147,7 @@ context('/src/Marks/Link/React/', () => {
|
|||||||
disallowedDomains.forEach(url => {
|
disallowedDomains.forEach(url => {
|
||||||
cy.get('.tiptap').then(([{ editor }]) => {
|
cy.get('.tiptap').then(([{ editor }]) => {
|
||||||
editor.commands.setContent(`<p><a href="${url}">Example Text</a></p>`)
|
editor.commands.setContent(`<p><a href="${url}">Example Text</a></p>`)
|
||||||
expect(editor.getHTML()).to.not.include(`<a href="${url}">`)
|
expect(editor.getHTML()).to.not.include(url)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -73,7 +73,7 @@ export interface LinkOptions {
|
|||||||
HTMLAttributes: Record<string, any>
|
HTMLAttributes: Record<string, any>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A validation function that modifies link verification for the auto linker.
|
* A validation function that modifies link verification.
|
||||||
* @param url - The url to be validated.
|
* @param url - The url to be validated.
|
||||||
* @param ctx - An object containing:
|
* @param ctx - An object containing:
|
||||||
* - `defaultValidate`: A function that performs the default URL validation.
|
* - `defaultValidate`: A function that performs the default URL validation.
|
||||||
|
Loading…
Reference in New Issue
Block a user