File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -612,7 +612,9 @@ function rehype2note(rehype: HRoot) {
612612}
613613
614614function content2diff ( oldStr : string , newStr : string ) {
615- return diffChars ( oldStr , newStr ) ;
615+ const diff = diffChars ( oldStr , newStr ) ;
616+ if ( ! diff ) return [ ] ;
617+ return diff ;
616618}
617619
618620async function md2html ( md : string ) {
Original file line number Diff line number Diff line change @@ -21,10 +21,8 @@ export async function showSyncDiff(noteId: number, mdPath: string) {
2121 } ) ;
2222 const noteContent = await addon . api . convert . note2noteDiff ( noteItem ) ;
2323 ztoolkit . log ( mdNoteContent , noteContent ) ;
24- const changes = await addon . api . convert . content2diff (
25- noteContent ,
26- mdNoteContent ,
27- ) ;
24+ const changes =
25+ ( await addon . api . convert . content2diff ( noteContent , mdNoteContent ) ) || [ ] ;
2826 ztoolkit . log ( "changes" , changes ) ;
2927
3028 const syncDate = new Date ( syncStatus . lastsync ) ;
You can’t perform that action at this time.
0 commit comments