Skip to content

Commit

Permalink
fix: close #472 修复点击draw.io图片出现无法回显编辑内容的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Jun 26, 2023
1 parent 08c351b commit 047d48e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/hooks/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ export default class Image extends SyntaxBase {
srcValue = imgAttrs.src || link;
}
const extendAttrStr = extendAttrs
? extendAttrs.replace(/[{}]/g, '').replace(/([^=\s]+)=([^\s]+)/g, '$1="$2"')
? extendAttrs
.replace(/[{}]/g, '')
.replace(/([^=\s]+)=([^\s]+)/g, '$1="$2"')
.replace(/&/g, '&') // 对&多做一次转义,cherry现有的机制会自动把&转成&,只有多做一次转义才能抵消cherry的机制
: '';
return `${leadingChar}<img ${srcProp}="${UrlCache.set(
encodeURIOnce(this.urlProcessor(srcValue, 'image')),
Expand Down

0 comments on commit 047d48e

Please sign in to comment.