@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.
- package/dist/hook/index.js +7 -0
- package/dist/type/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/hook/index.js
CHANGED
|
@@ -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') {
|
package/dist/type/index.d.ts
CHANGED
|
@@ -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;
|