-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
502 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@tiptap/extension-list-keymap": patch | ||
--- | ||
|
||
Fix backspace behavior when selection is not collapsed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@tiptap/vue-3": patch | ||
--- | ||
|
||
Fix editor destruction before transition end if editor is nested |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@tiptap/extension-bubble-menu": patch | ||
--- | ||
|
||
Add `element: HTMLElement` to `shouldShow` options within the BubbleMenu options. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@tiptap/core": patch | ||
--- | ||
|
||
feat: add `once` to EventEmitters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@tiptap/vue-2": patch | ||
--- | ||
|
||
Pin vue-ts-types to a working version for vue-2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@tiptap/react": patch | ||
--- | ||
|
||
React 19 is now allowed as a peer dep, we did not have to make any changes for React 19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@tiptap/core": patch | ||
"@tiptap/extension-hard-break": patch | ||
--- | ||
|
||
Add Node `linebreakReplacement` support and enable on hard-break nodes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@tiptap/core": patch | ||
--- | ||
|
||
Improve handling of selections with `updateAttributes`. Should no longer modify parent nodes of the same type. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@tiptap/extension-link": patch | ||
"tiptap-demos": patch | ||
--- | ||
|
||
The link extension's `validate` option now applies to both auto-linking and XSS mitigation. While, the new `shouldAutoLink` option is used to disable auto linking on an otherwise valid url. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<template> | ||
<div> | ||
<EditorContent :editor="editor" /> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import StarterKit from '@tiptap/starter-kit' | ||
import { EditorContent, useEditor } from '@tiptap/vue-3' | ||
import { ref } from 'vue' | ||
import VueComponent from './Extension.js' | ||
import type { TNote } from './types.js' | ||
const note = ref<TNote>({ | ||
id: 'note-1', | ||
content: ` | ||
<p>Some random note text</p> | ||
<vue-component count="0"></vue-component> | ||
`, | ||
}) | ||
const editor = useEditor({ | ||
content: note.value.content, | ||
editorProps: { | ||
attributes: { | ||
class: 'textarea', | ||
}, | ||
}, | ||
extensions: [ | ||
StarterKit, | ||
VueComponent, | ||
], | ||
}) | ||
</script> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,27 +12,27 @@ context('/src/Marks/Link/React/', () => { | |
|
||
it('should parse a tags correctly', () => { | ||
cy.get('.tiptap').then(([{ editor }]) => { | ||
editor.commands.setContent('<p><a href="#">Example Text1</a></p>') | ||
editor.commands.setContent('<p><a href="https://example.com">Example Text1</a></p>') | ||
expect(editor.getHTML()).to.eq( | ||
'<p><a target="_blank" rel="noopener noreferrer nofollow" href="#">Example Text1</a></p>', | ||
'<p><a target="_blank" rel="noopener noreferrer nofollow" href="https://example.com">Example Text1</a></p>', | ||
) | ||
}) | ||
}) | ||
|
||
it('should parse a tags with target attribute correctly', () => { | ||
cy.get('.tiptap').then(([{ editor }]) => { | ||
editor.commands.setContent('<p><a href="#" target="_self">Example Text2</a></p>') | ||
editor.commands.setContent('<p><a href="https://example.com" target="_self">Example Text2</a></p>') | ||
expect(editor.getHTML()).to.eq( | ||
'<p><a target="_self" rel="noopener noreferrer nofollow" href="#">Example Text2</a></p>', | ||
'<p><a target="_self" rel="noopener noreferrer nofollow" href="https://example.com">Example Text2</a></p>', | ||
) | ||
}) | ||
}) | ||
|
||
it('should parse a tags with rel attribute correctly', () => { | ||
cy.get('.tiptap').then(([{ editor }]) => { | ||
editor.commands.setContent('<p><a href="#" rel="follow">Example Text3</a></p>') | ||
editor.commands.setContent('<p><a href="https://example.com" rel="follow">Example Text3</a></p>') | ||
expect(editor.getHTML()).to.eq( | ||
'<p><a target="_blank" rel="follow" href="#">Example Text3</a></p>', | ||
'<p><a target="_blank" rel="follow" href="https://example.com">Example Text3</a></p>', | ||
) | ||
}) | ||
}) | ||
|
@@ -54,7 +54,7 @@ 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>') | ||
editor.commands.setContent('<p><a href="https://example.com" target="_self">Example Text2</a></p>') | ||
cy.get('.tiptap').type('{rightArrow}') | ||
|
||
cy.get('button:first').should('not.have.class', 'is-active') | ||
|
@@ -129,4 +129,32 @@ context('/src/Marks/Link/React/', () => { | |
.find('a[href="http://example3.com/foobar"]') | ||
.should('contain', 'http://example3.com/foobar') | ||
}) | ||
|
||
it('should not allow links with disallowed protocols', () => { | ||
const disallowedProtocols = ['ftp://example.com', 'file:///example.txt', 'mailto:[email protected]'] | ||
|
||
disallowedProtocols.forEach(url => { | ||
cy.get('.tiptap').then(([{ editor }]) => { | ||
editor.commands.setContent(`<p><a href="${url}">Example Text</a></p>`) | ||
expect(editor.getHTML()).to.not.include(url) | ||
}) | ||
}) | ||
}) | ||
|
||
it('should not allow links with disallowed domains', () => { | ||
const disallowedDomains = ['https://example-phishing.com', 'https://malicious-site.net'] | ||
|
||
disallowedDomains.forEach(url => { | ||
cy.get('.tiptap').then(([{ editor }]) => { | ||
editor.commands.setContent(`<p><a href="${url}">Example Text</a></p>`) | ||
expect(editor.getHTML()).to.not.include(url) | ||
}) | ||
}) | ||
}) | ||
|
||
it('should not auto-link a URL from a disallowed domain', () => { | ||
cy.get('.tiptap').type('https://example-phishing.com ') // disallowed domain | ||
cy.get('.tiptap').should('not.have.descendants', 'a') | ||
cy.get('.tiptap').should('contain.text', 'https://example-phishing.com') | ||
}) | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.