File tree Expand file tree Collapse file tree 5 files changed +21
-5
lines changed
Expand file tree Collapse file tree 5 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ The label of a draw.io image block can be configured in the plugin settings.
8181
8282## Changelog
8383
84+ + v0.5.3
85+ + Fix: unable to save when saving large content
8486+ v0.5.2
8587 + Optimize: Excalidraw contents of SVG/PNG placeholder image are empty
8688+ v0.5.1
Original file line number Diff line number Diff line change 7070
7171## 更新日志
7272
73+ + v0.5.3
74+ + 修复缺陷:内容过多时无法保存
7375+ v0.5.2
7476 + 优化:SVG/PNG占位图像编辑时都为空
7577+ v0.5.1
Original file line number Diff line number Diff line change 11{
22 "name" : " siyuan-embed-drawio" ,
3- "version" : " 0.5.2 " ,
3+ "version" : " 0.5.3 " ,
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.5.2 " ,
5+ "version" : " 0.5.3 " ,
66 "minAppVersion" : " 3.0.0" ,
77 "disabledInPublish" : true ,
88 "backends" : [
Original file line number Diff line number Diff line change @@ -20,7 +20,12 @@ export function unescapeHTML(str: string): string {
2020export function unicodeToBase64 ( str : string ) : string {
2121 const encoder = new TextEncoder ( ) ;
2222 const bytes = encoder . encode ( str ) ;
23- return btoa ( String . fromCharCode ( ...bytes ) ) ;
23+ let binary = '' ;
24+ const len = bytes . length ;
25+ for ( let i = 0 ; i < len ; i ++ ) {
26+ binary += String . fromCharCode ( bytes [ i ] ) ;
27+ }
28+ return btoa ( binary ) ;
2429}
2530
2631export function base64ToUnicode ( base64 : string ) : string {
@@ -43,7 +48,11 @@ export function base64ToBuffer(base64: string): ArrayBuffer {
4348}
4449
4550export function bufferToBase64 ( buffer : ArrayBuffer ) : string {
46- const binary = String . fromCharCode ( ...new Uint8Array ( buffer ) ) ;
51+ const bytes = new Uint8Array ( buffer ) ;
52+ let binary = '' ;
53+ for ( let i = 0 ; i < bytes . length ; i ++ ) {
54+ binary += String . fromCharCode ( bytes [ i ] ) ;
55+ }
4756 return btoa ( binary ) ;
4857}
4958
@@ -99,7 +108,10 @@ export function base64ToArray(base64: string): Uint8Array {
99108}
100109
101110export function arrayToBase64 ( array : Uint8Array ) : string {
102- const binary = String . fromCharCode ( ...array ) ;
111+ let binary = '' ;
112+ for ( let i = 0 ; i < array . length ; i ++ ) {
113+ binary += String . fromCharCode ( array [ i ] ) ;
114+ }
103115 return btoa ( binary ) ;
104116}
105117
You can’t perform that action at this time.
0 commit comments