Getting the new new new rich text editor working. I think it is working... Yay Shad Editor that uses TipTap and Shadcn.
This commit is contained in:
@@ -42,9 +42,17 @@
|
||||
class?: string;
|
||||
content?: Content;
|
||||
showToolbar?: boolean;
|
||||
// html_text?: string;
|
||||
new_html?: string;
|
||||
}
|
||||
|
||||
let { class: className = '', content = $bindable(''), showToolbar = true }: Props = $props();
|
||||
let { class:
|
||||
className = '',
|
||||
content = $bindable(''),
|
||||
showToolbar = true,
|
||||
// html_text = '',
|
||||
new_html = $bindable(''),
|
||||
}: Props = $props();
|
||||
|
||||
let editor = $state<Editor>();
|
||||
let element = $state<HTMLElement>();
|
||||
@@ -133,6 +141,12 @@
|
||||
editor = transaction.editor;
|
||||
console.log(editor.isActive('bold'));
|
||||
content = editor.getHTML();
|
||||
console.log(content);
|
||||
if (content == '<p></p>') {
|
||||
new_html = '';
|
||||
} else {
|
||||
new_html = content ?? '';
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user