-
|
I found these methods on the editor in the tiptap docs: const json = editor.getJSON()
// ...and...
const html = editor.getHTML()...and I tried adding that in the onMount call in the Editor component: let editor: Readable<Editor>;
let json;
$: console.log(json)
onMount(() => {
editor = createEditor({
extensions: [StarterKit, Underline, SvelteCounterExtension, SvelteEditableExtension],
content: ` ...content... `,
editorProps: {
attributes: {
class: '',
},
},
});
json = editor.getJSON()
});...and I get the following errors in the console: ...and this warning in the terminal: ...soooo...not quite sure how I should go about getting the output in JSON or HTML form... Any thoughts/advice is appreciated, thanks :-) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
editor is a readable instance. You should do onMount(() => {
editor = createEditor({
// ...options
});
json = $editor.getJSON()
}); |
Beta Was this translation helpful? Give feedback.
-
|
sheeesh! my bad, keep missing little things like this. Yeah, it works just fine now, thanks! XD |
Beta Was this translation helpful? Give feedback.
-
|
This discussion has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related items and link to relevant comments in the thread. |
Beta Was this translation helpful? Give feedback.
editor is a readable instance. You should do