mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-01 01:12:43 -05:00
refac
This commit is contained in:
1 parent
b6a77a0f12
commit
c31cdb4e86
9 files changed
+218
-147
No files matched your search
@@ -123,12 +123,6 @@ export const Image = Node.create<ImageOptions>({
|
||||
|
||||
addNodeView() {
|
||||
return ({ node, editor }) => {
|
||||
const domImg = document.createElement('img');
|
||||
domImg.setAttribute('src', node.attrs.src || '');
|
||||
domImg.setAttribute('alt', node.attrs.alt || '');
|
||||
domImg.setAttribute('title', node.attrs.title || '');
|
||||
|
||||
const container = document.createElement('div');
|
||||
const img = document.createElement('img');
|
||||
|
||||
const fileId = node.attrs.src.replace('data://', '');
|
||||
@@ -164,11 +158,8 @@ export const Image = Node.create<ImageOptions>({
|
||||
}
|
||||
});
|
||||
|
||||
container.append(img);
|
||||
return {
|
||||
dom: img,
|
||||
contentDOM: domImg
|
||||
};
|
||||
// Images are leaf nodes; a detached contentDOM breaks cursor positioning.
|
||||
return { dom: img };
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user