@ctzhian/tiptap 1.8.2-beta.1 → 1.8.2-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -106,6 +106,13 @@ var useTiptap = function useTiptap(_ref) {
106
106
  contentType: contentType === 'markdown' ? 'markdown' : 'html'
107
107
  })) === null || _editor$chain === void 0 || _editor$chain.run();
108
108
  },
109
+ getContent: function getContent() {
110
+ if (!editor) return '';
111
+ if (contentType === 'markdown') {
112
+ return editor.getMarkdown();
113
+ }
114
+ return editor.getHTML() || '';
115
+ },
109
116
  getMarkdown: function getMarkdown() {
110
117
  if (!editor) return '';
111
118
  if (contentType === 'markdown') {
@@ -100,6 +100,7 @@ export type GetExtensionsProps = ExtensionRelativeProps;
100
100
  export type UseTiptapReturn = {
101
101
  editor: Editor;
102
102
  setContent: (value: string) => void;
103
+ getContent: () => string;
103
104
  getMarkdown: () => string;
104
105
  getText: () => string;
105
106
  getHTML: () => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctzhian/tiptap",
3
- "version": "1.8.2-beta.1",
3
+ "version": "1.8.2-beta.2",
4
4
  "description": "基于 Tiptap 二次开发的编辑器组件",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",