File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -420,10 +420,15 @@ export class TransclusionHandler {
420420 let href = a . getAttr ( 'href' ) ;
421421 // --> If no Alt Text, Add href as Link Text
422422 if ( a . innerText === '' ) a . innerText = decodeURI ( href ) ;
423- // If the link is a file, add class (which has event listener in main)
423+ // --> If link is a translucion, change the href to file name
424424 if ( href . match ( new RegExp ( '.*#.*' ) ) ) href = href . match ( new RegExp ( '.*(?=#)' ) ) [ 0 ] ;
425+ // --> If link is a file, add class (which has event listener in main)
426+ // and decode href for obsidian
425427 let file = app . metadataCache . getFirstLinkpathDest ( decodeURI ( href ) , '' ) ;
426- if ( file ) a . addClass ( 'oz-obsidian-inner-link' ) ;
428+ if ( file ) {
429+ a . setAttr ( 'href' , decodeURI ( href ) ) ;
430+ a . addClass ( 'oz-obsidian-inner-link' ) ;
431+ }
427432 } ) ;
428433 } ;
429434}
You can’t perform that action at this time.
0 commit comments