mirror of
https://github.com/open-webui/open-webui
synced 2025-06-04 03:37:35 +00:00
fix: codeblock
This commit is contained in:
parent
7a63947b94
commit
802f8809dd
@ -464,8 +464,8 @@
|
|||||||
onSave={() => {
|
onSave={() => {
|
||||||
saveCode();
|
saveCode();
|
||||||
}}
|
}}
|
||||||
onChange={(e) => {
|
onChange={(value) => {
|
||||||
_code = e;
|
_code = value;
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -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
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -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([]),
|
||||||
|
Loading…
Reference in New Issue
Block a user