File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,13 @@ async function initElements(elements) {
4545 if ( pathElement ) {
4646 let path =
4747 pathElement . getAttribute ( "path" ) || getPath ( ) ;
48- if ( path ) text = text . replaceAll ( "$relativePath" , path ) ;
48+ if ( path ) {
49+ // Remove trailing slash if present
50+ if ( path . endsWith ( "/" ) ) {
51+ path = path . slice ( 0 , - 1 ) ;
52+ }
53+ text = text . replaceAll ( "$relativePath" , path ) ;
54+ }
4955 }
5056
5157 text = text . replaceAll ( "ObjectId()" , ( ) => {
Original file line number Diff line number Diff line change @@ -1331,7 +1331,11 @@ Observer.init({
13311331 types : [ "addedNodes" ] ,
13321332 selector : "[render-clone]" ,
13331333 callback : function ( mutation ) {
1334- if ( ! mutation . parentElement . hasAttribute ( "dnd" ) ) return ;
1334+ if (
1335+ mutation . parentElement &&
1336+ ! mutation . parentElement . hasAttribute ( "dnd" )
1337+ )
1338+ return ;
13351339 let delayTimer = debounce . get ( mutation ) ;
13361340 clearTimeout ( delayTimer ) ;
13371341 debounce . delete ( mutation . target ) ;
You can’t perform that action at this time.
0 commit comments