Skip to content

Commit d7543db

Browse files
committed
Merge branch 'main' of github.com:ueberdosis/tiptap into develop
2 parents 401fe3f + 035b3f2 commit d7543db

File tree

151 files changed

+1925
-249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+1925
-249
lines changed

.changeset/commands-exported.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
33
"changelog": "@changesets/cli/changelog",
44
"commit": false,
5-
"fixed": [["@tiptap/*", "!@tiptap/markdown"], ["@tiptap/markdown"]],
5+
"fixed": [["@tiptap/*"]],
66
"linked": [],
77
"access": "public",
88
"baseBranch": "main",

.changeset/hip-rats-buy.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/silly-singers-sleep.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

.changeset/strange-planes-float.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/strong-knives-smile.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/trailing-node-node-optional.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

.changeset/wild-boats-rhyme.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,138 @@
11
# Releases
22

3+
## v3.7.2
4+
5+
### @tiptap/html
6+
7+
#### Patch Changes
8+
9+
- Fix [CVE-2025-62410](https://www.cve.org/CVERecord?id=CVE-2025-62410) by updating happy-dom to ^20.0.2
10+
11+
## v3.7.1
12+
13+
### @tiptap/markdown
14+
15+
#### Patch Changes
16+
17+
- Editors will not throw an error anymore when `content` is an empty string and `contentType` is `markdown`
18+
- Remove invalid server configuration from package.json
19+
20+
## v3.7.0
21+
22+
### @tiptap/core
23+
24+
#### Minor Changes
25+
26+
- All commands and their corresponding TypeScript types are now exported from `@tiptap/core` so they can be imported and referenced directly by consumers. This makes it easier to build typed helpers, extensions, and tests that depend on the command signatures.
27+
28+
Why:
29+
- Previously some command option types were only available as internal types or scattered across files, which made it awkward for downstream users to import and reuse them.
30+
31+
```ts
32+
import { commands } from '@tiptap/core'
33+
```
34+
35+
Notes:
36+
- This is a non-breaking, additive change. It improves ergonomics for TypeScript consumers.
37+
- If you rely on previously private/internal types, prefer the exported types from `@tiptap/core` going forward.
38+
- Add comprehensive bidirectional markdown support to Tiptap through a new `@tiptap/markdown` package and Markdown utilities in `@tiptap/core`.
39+
40+
**New Package: `@tiptap/markdown`** - A new official extension that provides full Markdown parsing and serialization capabilities using [MarkedJS](https://marked.js.org) as the underlying Markdown parser.
41+
42+
**Core Features:**
43+
44+
**Extension API**
45+
- **`Markdown` Extension**: Main extension that adds Markdown support to your editor
46+
- **`MarkdownManager`**: Core engine for parsing and serializing Markdown
47+
- Parse Markdown strings to Tiptap JSON: `editor.markdown.parse(markdown)`
48+
- Serialize Tiptap JSON to Markdown: `editor.markdown.serialize(json)`
49+
- Access to underlying marked.js instance: `editor.markdown.instance`
50+
51+
#### Editor Methods
52+
- **`editor.getMarkdown()`**: Serialize current editor content to Markdown string
53+
- **`editor.markdown`**: Access to MarkdownManager instance for advanced operations
54+
55+
**Editor Options:**
56+
- **`contentType`**: Control the type of content that is inserted into the editor. Can be `json`, `html` or `markdown` - defaults to `json` and will automatically detect invalid content types (like JSON when it is actually Markdown).
57+
```typescript
58+
new Editor({
59+
content: '# Hello World',
60+
contentType: 'markdown'
61+
})
62+
```
63+
64+
**Command Options:** All content commands now support an `contentType` option:
65+
- **`setContent(markdown, { contentType: 'markdown' })`**: Replace editor content with markdown
66+
- **`insertContent(markdown, { contentType: 'markdown' })`**: Insert markdown at cursor position
67+
- **`insertContentAt(position, markdown, { contentType: 'markdown' })`**: Insert Markdown at specific position
68+
69+
For more, check [the documentation](https://tiptap.dev/docs/editor/markdown).
70+
71+
#### Patch Changes
72+
73+
- The extension manager now provides a new property `baseExtensions` that contains an unflattened array of extensions
74+
75+
### @tiptap/markdown
76+
77+
#### Minor Changes
78+
79+
- Add comprehensive bidirectional markdown support to Tiptap through a new `@tiptap/markdown` package and Markdown utilities in `@tiptap/core`.
80+
81+
**New Package: `@tiptap/markdown`** - A new official extension that provides full Markdown parsing and serialization capabilities using [MarkedJS](https://marked.js.org) as the underlying Markdown parser.
82+
83+
**Core Features:**
84+
85+
**Extension API**
86+
- **`Markdown` Extension**: Main extension that adds Markdown support to your editor
87+
- **`MarkdownManager`**: Core engine for parsing and serializing Markdown
88+
- Parse Markdown strings to Tiptap JSON: `editor.markdown.parse(markdown)`
89+
- Serialize Tiptap JSON to Markdown: `editor.markdown.serialize(json)`
90+
- Access to underlying marked.js instance: `editor.markdown.instance`
91+
92+
#### Editor Methods
93+
- **`editor.getMarkdown()`**: Serialize current editor content to Markdown string
94+
- **`editor.markdown`**: Access to MarkdownManager instance for advanced operations
95+
96+
**Editor Options:**
97+
- **`contentType`**: Control the type of content that is inserted into the editor. Can be `json`, `html` or `markdown` - defaults to `json` and will automatically detect invalid content types (like JSON when it is actually Markdown).
98+
```typescript
99+
new Editor({
100+
content: '# Hello World',
101+
contentType: 'markdown'
102+
})
103+
```
104+
105+
**Command Options:** All content commands now support an `contentType` option:
106+
- **`setContent(markdown, { contentType: 'markdown' })`**: Replace editor content with markdown
107+
- **`insertContent(markdown, { contentType: 'markdown' })`**: Insert markdown at cursor position
108+
- **`insertContentAt(position, markdown, { contentType: 'markdown' })`**: Insert Markdown at specific position
109+
110+
For more, check [the documentation](https://tiptap.dev/docs/editor/markdown).
111+
112+
### @tiptap/extension-link
113+
114+
#### Patch Changes
115+
116+
- Paste Handlers and onPaste plugin now respect shouldAutoLink/validate options
117+
118+
### @tiptap/extensions
119+
120+
#### Patch Changes
121+
122+
- Make the `TrailingNode` extension's `node` option optional and derive the
123+
default node type from the editor schema when available.
124+
125+
Previously the extension used a hard-coded `'paragraph'` default and the
126+
`node` option was required in the TypeScript definitions. This change:
127+
128+
- makes `node` optional in the options type,
129+
- prefers the editor schema's top node default type when resolving the
130+
trailing node, and
131+
- falls back to the configured option or `'paragraph'` as a last resort.
132+
133+
This fixes cases where projects use a different top-level default node and
134+
prevents the extension from inserting an incorrect trailing node type.
135+
3136
## v3.6.7
4137

5138
### @tiptap/html

demos/src/Markdown/Full/React/index.tsx

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -158,64 +158,6 @@ export default () => {
158158
}
159159
}
160160

161-
const insertImage = () => {
162-
const url = prompt('Enter image URL:', 'https://unsplash.it/400/300')
163-
if (url && editor) {
164-
editor.chain().focus().setImage({ src: url }).run()
165-
}
166-
}
167-
168-
const insertYoutube = () => {
169-
const url = prompt('Enter YouTube URL:', 'https://www.youtube.com/watch?v=dQw4w9WgXcQ')
170-
if (url && editor) {
171-
editor.chain().focus().setYoutubeVideo({ src: url }).run()
172-
}
173-
}
174-
175-
const insertMention = () => {
176-
const name = prompt('Enter mention name:', 'John Doe')
177-
if (name && editor) {
178-
// Generate a simple ID based on the name
179-
const id = Math.random().toString(36).substring(2, 9)
180-
editor.chain().focus().insertContent(`[@ id="${id}" label="${name}"]`, { contentType: 'markdown' }).run()
181-
}
182-
}
183-
184-
const insertCustomReactNode = () => {
185-
const content = prompt('Enter content for custom React node:', 'Hello from React!')
186-
if (content && editor) {
187-
editor.chain().focus().insertContent(`:::react\n\n${content}\n\n:::`, { contentType: 'markdown' }).run()
188-
}
189-
}
190-
191-
const insertInlineMath = () => {
192-
const latex = prompt('Enter LaTeX for inline math:', 'E = mc^2')
193-
if (latex && editor) {
194-
editor
195-
.chain()
196-
.focus()
197-
.insertContent({
198-
type: 'inlineMath',
199-
attrs: { latex },
200-
})
201-
.run()
202-
}
203-
}
204-
205-
const insertBlockMath = () => {
206-
const latex = prompt('Enter LaTeX for block math:', '\\int_{-\\infty}^{\\infty} e^{-x^2} dx = \\sqrt{\\pi}')
207-
if (latex && editor) {
208-
editor
209-
.chain()
210-
.focus()
211-
.insertContent({
212-
type: 'blockMath',
213-
attrs: { latex },
214-
})
215-
.run()
216-
}
217-
}
218-
219161
return (
220162
<div className="markdown-parser-demo">
221163
<div className="control-group">
@@ -253,29 +195,6 @@ export default () => {
253195

254196
<div className="editor-panel">
255197
<div className="panel-label">Tiptap Editor</div>
256-
257-
{/* Toolbar */}
258-
<div className="editor-toolbar button-group">
259-
<button type="button" onClick={insertImage} disabled={!editor} title="Insert Image">
260-
Insert Image
261-
</button>
262-
<button type="button" onClick={insertYoutube} disabled={!editor} title="Insert YouTube Video">
263-
Insert YouTube
264-
</button>
265-
<button type="button" onClick={insertMention} disabled={!editor} title="Insert Mention">
266-
Insert Mention
267-
</button>
268-
<button type="button" onClick={insertInlineMath} disabled={!editor} title="Insert Inline Math">
269-
Insert Inline Math
270-
</button>
271-
<button type="button" onClick={insertBlockMath} disabled={!editor} title="Insert Block Math">
272-
Insert Block Math
273-
</button>
274-
<button type="button" onClick={insertCustomReactNode} disabled={!editor} title="Insert Custom React Node">
275-
Insert React Node
276-
</button>
277-
</div>
278-
279198
<div className="editor-container">
280199
{editor ? <EditorContent editor={editor} /> : <div>Loading editor…</div>}
281200
</div>

0 commit comments

Comments
 (0)