File tree Expand file tree Collapse file tree 5 files changed +11
-6
lines changed
Expand file tree Collapse file tree 5 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ Click the menu button in the top-right corner of the image. If the block is reco
5151
5252## Changelog
5353
54+ + v0.1.6
55+ + Fix: load cache image mistakely
5456+ v0.1.5
5557 + Fix: avoid CSS5 ligh-dark style rendering fail in some browsers
5658+ v0.1.4
Original file line number Diff line number Diff line change 5050
5151## 更新日志
5252
53+ + v0.1.6
54+ + 修复缺陷:错误地加载到浏览器缓存图像
5355+ v0.1.5
5456 + 修复缺陷:避免使用CSS5的light-dark样式导致部分浏览器显示异常
5557+ v0.1.4
Original file line number Diff line number Diff line change 11{
22 "name" : " siyuan-embed-drawio" ,
3- "version" : " 0.1.5 " ,
3+ "version" : " 0.1.6 " ,
44 "type" : " module" ,
55 "description" : " This is a plugin for siyuan" ,
66 "author" : " " ,
Original file line number Diff line number Diff line change 22 "name" : " siyuan-embed-drawio" ,
33 "author" : " Yuxin Zhao" ,
44 "url" : " https://github.com/YuxinZhaozyx/siyuan-embed-drawio" ,
5- "version" : " 0.1.5 " ,
5+ "version" : " 0.1.6 " ,
66 "minAppVersion" : " 3.3.0" ,
77 "disabledInPublish" : true ,
88 "backends" : [
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ export default class DrawioPlugin extends Plugin {
132132 }
133133
134134 public async getDrawioImage ( imageURL : string ) : Promise < string > {
135- const response = await fetch ( imageURL ) ;
135+ const response = await fetch ( imageURL , { cache : 'reload' } ) ;
136136 if ( ! response . ok ) return "" ;
137137 const svgContent = await response . text ( ) ;
138138 return svgContent ;
@@ -242,9 +242,10 @@ export default class DrawioPlugin extends Plugin {
242242 messageKey : 'allChangesSaved' ,
243243 modified : false
244244 } ) ;
245- const timestamp = Date . now ( ) ;
246- document . querySelectorAll ( `img[data-src='${ imageInfo . imageURL } ']` ) . forEach ( imageElement => {
247- ( imageElement as HTMLImageElement ) . src = imageInfo . imageURL + "?t=" + timestamp ; // 重载图片,加时间戳以避免浏览器缓存图片
245+ fetch ( imageInfo . imageURL , { cache : 'reload' } ) . then ( ( ) => {
246+ document . querySelectorAll ( `img[data-src='${ imageInfo . imageURL } ']` ) . forEach ( imageElement => {
247+ ( imageElement as HTMLImageElement ) . src = imageInfo . imageURL ;
248+ } ) ;
248249 } ) ;
249250 } ) ;
250251 }
You can’t perform that action at this time.
0 commit comments