File tree Expand file tree Collapse file tree 4 files changed +22
-16
lines changed Expand file tree Collapse file tree 4 files changed +22
-16
lines changed Original file line number Diff line number Diff line change 11{
22 "id" : " obsidian-admonition" ,
33 "name" : " Admonition" ,
4- "version" : " 4.3.0 " ,
4+ "version" : " 4.3.1 " ,
55 "minAppVersion" : " 0.11.0" ,
66 "description" : " Admonition block-styled content for Obsidian.md" ,
77 "author" : " Jeremy Valentine" ,
Original file line number Diff line number Diff line change 11{
22 "name" : " obsidian-admonition" ,
3- "version" : " 4.3.0 " ,
3+ "version" : " 4.3.1 " ,
44 "description" : " Admonition block-styled content for Obsidian.md" ,
55 "main" : " main.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -461,28 +461,34 @@ export default class ObsidianAdmonition
461461 sourcePath : string
462462 ) : void {
463463 if ( ! this . data . syncLinks ) return ;
464-
464+ /* //@ts -expect-error
465+ this.app.metadataCache.resolveLinks(sourcePath); */
465466 for ( let i = 0 ; i < links . length ; i ++ ) {
466467 const a = links [ i ] ;
467468 if ( a . dataset . href ) {
468469 let file = this . app . metadataCache . getFirstLinkpathDest (
469470 a . dataset . href ,
470471 ""
471472 ) ;
473+ let cache , path ;
472474 if ( file && file instanceof TFile ) {
473- if ( ! this . app . metadataCache . resolvedLinks [ sourcePath ] ) {
474- this . app . metadataCache . resolvedLinks [ sourcePath ] = {
475- [ file . path ] : 0
476- } ;
477- }
478- let resolved =
479- this . app . metadataCache . resolvedLinks [ sourcePath ] ;
480- if ( ! resolved [ file . path ] ) {
481- resolved [ file . path ] = 0 ;
482- }
483- resolved [ file . path ] += 1 ;
484- this . app . metadataCache . resolvedLinks [ sourcePath ] = resolved ;
475+ cache = this . app . metadataCache . resolvedLinks ;
476+ path = file . path ;
477+ } else {
478+ cache = this . app . metadataCache . unresolvedLinks ;
479+ path = a . dataset . href ;
480+ }
481+ if ( ! cache [ sourcePath ] ) {
482+ cache [ sourcePath ] = {
483+ [ path ] : 0
484+ } ;
485+ }
486+ let resolved = cache [ sourcePath ] ;
487+ if ( ! resolved [ path ] ) {
488+ resolved [ path ] = 0 ;
485489 }
490+ resolved [ path ] += 1 ;
491+ cache [ sourcePath ] = resolved ;
486492 }
487493 }
488494 }
Original file line number Diff line number Diff line change 88 "4.0.1" : " 0.11.0" ,
99 "4.1.7" : " 0.11.0" ,
1010 "4.2.1" : " 0.11.0" ,
11- "4.3.0 " : " 0.12.0"
11+ "4.3.1 " : " 0.12.0"
1212}
You can’t perform that action at this time.
0 commit comments