Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kanyxmo committed Aug 22, 2023
1 parent 55de7e8 commit d3d0012
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/ma-editor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
let tmp = ''
imgs.map(img => {
if (img.indexOf('.jpg') > -1 || img.indexOf('.png') > -1 || img.indexOf('.bmp') > -1 || img.indexOf('.jpeg') > -1 || img.indexOf('.svg') > -1 || img.indexOf('.gif') > -1) {
tmp += `<img src=${ /^http|https/g.test(img) ? img : tool.attachUrl(img)} width="100%" />`
tmp += `<img src=${ /^http|https/g.test(img) ? img : tool.attachUrl(img) } width="100%" />`
}
})
content.value = content.value ? content.value + tmp : tmp
Expand Down
2 changes: 1 addition & 1 deletion src/components/ma-wangEditor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ watch(
imgs.map(img => {
if (img.indexOf('.jpg') > -1 || img.indexOf('.png') > -1 || img.indexOf('.bmp') > -1 || img.indexOf('.jpeg') > -1 || img.indexOf('.svg') > -1 || img.indexOf('.gif') > -1) {
const node = {"type":"image","src":img,"href":"","alt":"","style":{},"children":[{"text":""}]}
const node = {"type":"image","src": /^http|https/g.test(img) ? img : tool.attachUrl(img) ,"href":"","alt":"","style":{},"children":[{"text":""}]}
editorRef.value.insertNode(node)
}
})
Expand Down

0 comments on commit d3d0012

Please sign in to comment.