fix: codeblock

This commit is contained in:
Timothy Jaeryang Baek 2025-02-23 21:39:34 -08:00
parent 7a63947b94
commit 802f8809dd
3 changed files with 7 additions and 7 deletions

View File

@ -464,8 +464,8 @@
onSave={() => { onSave={() => {
saveCode(); saveCode();
}} }}
onChange={(e) => { onChange={(value) => {
_code = e; _code = value;
}} }}
/> />
</div> </div>

View File

@ -88,14 +88,14 @@
code={token?.text ?? ''} code={token?.text ?? ''}
{attributes} {attributes}
{save} {save}
onCode={(e) => { onCode={(value) => {
dispatch('code', e); dispatch('code', value);
}} }}
onSave={(e) => { onSave={(e) => {
dispatch('update', { dispatch('update', {
raw: token.raw, raw: token.raw,
oldContent: token.text, oldContent: token.text,
newContent: e newContent: value
}); });
}} }}
/> />

View File

@ -79,7 +79,7 @@
}); });
_value = formattedCode; _value = formattedCode;
onChange({ value: _value }); onChange(_value);
await tick(); await tick();
toast.success($i18n.t('Code formatted successfully')); toast.success($i18n.t('Code formatted successfully'));
@ -98,7 +98,7 @@
EditorView.updateListener.of((e) => { EditorView.updateListener.of((e) => {
if (e.docChanged) { if (e.docChanged) {
_value = e.state.doc.toString(); _value = e.state.doc.toString();
onChange({ value: _value }); onChange(_value);
} }
}), }),
editorTheme.of([]), editorTheme.of([]),