|
1 | 1 | # Releases |
2 | 2 |
|
| 3 | +## v3.7.0 |
| 4 | + |
| 5 | +### @tiptap/core |
| 6 | + |
| 7 | +#### Minor Changes |
| 8 | + |
| 9 | +- 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. |
| 10 | + |
| 11 | + Why: |
| 12 | + - 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. |
| 13 | + |
| 14 | + ```ts |
| 15 | + import { commands } from '@tiptap/core' |
| 16 | + ``` |
| 17 | + |
| 18 | + Notes: |
| 19 | + - This is a non-breaking, additive change. It improves ergonomics for TypeScript consumers. |
| 20 | + - If you rely on previously private/internal types, prefer the exported types from `@tiptap/core` going forward. |
| 21 | +- Add comprehensive bidirectional markdown support to Tiptap through a new `@tiptap/markdown` package and Markdown utilities in `@tiptap/core`. |
| 22 | + |
| 23 | + **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. |
| 24 | + |
| 25 | + **Core Features:** |
| 26 | + |
| 27 | + **Extension API** |
| 28 | + - **`Markdown` Extension**: Main extension that adds Markdown support to your editor |
| 29 | + - **`MarkdownManager`**: Core engine for parsing and serializing Markdown |
| 30 | + - Parse Markdown strings to Tiptap JSON: `editor.markdown.parse(markdown)` |
| 31 | + - Serialize Tiptap JSON to Markdown: `editor.markdown.serialize(json)` |
| 32 | + - Access to underlying marked.js instance: `editor.markdown.instance` |
| 33 | + |
| 34 | + #### Editor Methods |
| 35 | + - **`editor.getMarkdown()`**: Serialize current editor content to Markdown string |
| 36 | + - **`editor.markdown`**: Access to MarkdownManager instance for advanced operations |
| 37 | + |
| 38 | + **Editor Options:** |
| 39 | + - **`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). |
| 40 | + ```typescript |
| 41 | + new Editor({ |
| 42 | + content: '# Hello World', |
| 43 | + contentType: 'markdown' |
| 44 | + }) |
| 45 | + ``` |
| 46 | + |
| 47 | + **Command Options:** All content commands now support an `contentType` option: |
| 48 | + - **`setContent(markdown, { contentType: 'markdown' })`**: Replace editor content with markdown |
| 49 | + - **`insertContent(markdown, { contentType: 'markdown' })`**: Insert markdown at cursor position |
| 50 | + - **`insertContentAt(position, markdown, { contentType: 'markdown' })`**: Insert Markdown at specific position |
| 51 | + |
| 52 | + For more, check [the documentation](https://tiptap.dev/docs/editor/markdown). |
| 53 | + |
| 54 | +#### Patch Changes |
| 55 | + |
| 56 | +- The extension manager now provides a new property `baseExtensions` that contains an unflattened array of extensions |
| 57 | + |
| 58 | +### @tiptap/markdown |
| 59 | + |
| 60 | +#### Minor Changes |
| 61 | + |
| 62 | +- Add comprehensive bidirectional markdown support to Tiptap through a new `@tiptap/markdown` package and Markdown utilities in `@tiptap/core`. |
| 63 | + |
| 64 | + **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. |
| 65 | + |
| 66 | + **Core Features:** |
| 67 | + |
| 68 | + **Extension API** |
| 69 | + - **`Markdown` Extension**: Main extension that adds Markdown support to your editor |
| 70 | + - **`MarkdownManager`**: Core engine for parsing and serializing Markdown |
| 71 | + - Parse Markdown strings to Tiptap JSON: `editor.markdown.parse(markdown)` |
| 72 | + - Serialize Tiptap JSON to Markdown: `editor.markdown.serialize(json)` |
| 73 | + - Access to underlying marked.js instance: `editor.markdown.instance` |
| 74 | + |
| 75 | + #### Editor Methods |
| 76 | + - **`editor.getMarkdown()`**: Serialize current editor content to Markdown string |
| 77 | + - **`editor.markdown`**: Access to MarkdownManager instance for advanced operations |
| 78 | + |
| 79 | + **Editor Options:** |
| 80 | + - **`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). |
| 81 | + ```typescript |
| 82 | + new Editor({ |
| 83 | + content: '# Hello World', |
| 84 | + contentType: 'markdown' |
| 85 | + }) |
| 86 | + ``` |
| 87 | + |
| 88 | + **Command Options:** All content commands now support an `contentType` option: |
| 89 | + - **`setContent(markdown, { contentType: 'markdown' })`**: Replace editor content with markdown |
| 90 | + - **`insertContent(markdown, { contentType: 'markdown' })`**: Insert markdown at cursor position |
| 91 | + - **`insertContentAt(position, markdown, { contentType: 'markdown' })`**: Insert Markdown at specific position |
| 92 | + |
| 93 | + For more, check [the documentation](https://tiptap.dev/docs/editor/markdown). |
| 94 | + |
| 95 | +### @tiptap/extension-link |
| 96 | + |
| 97 | +#### Patch Changes |
| 98 | + |
| 99 | +- Paste Handlers and onPaste plugin now respect shouldAutoLink/validate options |
| 100 | + |
| 101 | +### @tiptap/extensions |
| 102 | + |
| 103 | +#### Patch Changes |
| 104 | + |
| 105 | +- Make the `TrailingNode` extension's `node` option optional and derive the |
| 106 | + default node type from the editor schema when available. |
| 107 | + |
| 108 | + Previously the extension used a hard-coded `'paragraph'` default and the |
| 109 | + `node` option was required in the TypeScript definitions. This change: |
| 110 | + |
| 111 | + - makes `node` optional in the options type, |
| 112 | + - prefers the editor schema's top node default type when resolving the |
| 113 | + trailing node, and |
| 114 | + - falls back to the configured option or `'paragraph'` as a last resort. |
| 115 | + |
| 116 | + This fixes cases where projects use a different top-level default node and |
| 117 | + prevents the extension from inserting an incorrect trailing node type. |
| 118 | + |
3 | 119 | ## v3.6.7 |
4 | 120 |
|
5 | 121 | ### @tiptap/html |
|
0 commit comments