File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,18 @@ export default {
8787 }
8888 // if pathname is undefined, meaning a docId/volume (e.g :primary:)
8989 // has not been detected, so no newDocId's ":" will be added.
90- if ( ! pathname ) return `${ contentUri . rootUri } ::${ root } ${ newDocId . startsWith ( "/" ) ? newDocId . slice ( 1 ) : newDocId } ${ query } `
90+ if ( ! pathname ) {
91+ // Ensure proper path separator between root and newDocId
92+ let separator = '' ;
93+ if ( root . endsWith ( '/' ) && newDocId . startsWith ( '/' ) ) {
94+ // Both have separator, strip one from newDocId
95+ newDocId = newDocId . slice ( 1 ) ;
96+ } else if ( ! root . endsWith ( '/' ) && ! newDocId . startsWith ( '/' ) ) {
97+ // Neither has separator, add one
98+ separator = '/' ;
99+ }
100+ return `${ contentUri . rootUri } ::${ root } ${ separator } ${ newDocId } ${ query } ` ;
101+ }
91102 return `${ contentUri . rootUri } ::${ root } ${ newDocId } ${ query } ` ;
92103 }
93104 return `${ contentUri . rootUri } ::${ root } :${ newDocId } ${ query } ` ;
You can’t perform that action at this time.
0 commit comments