File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ export function initRepoEditor() {
8181 let containSpace = false ;
8282 for ( let i = 0 ; i < parts . length ; ++ i ) {
8383 const value = parts [ i ] ;
84- if ( value . trim ( ) === '..' ) {
84+ const trimValue = value . trim ( ) ;
85+ if ( trimValue === '..' ) {
8586 // remove previous tree path
8687 if ( links . length > 0 ) {
8788 links [ links . length - 1 ] . remove ( ) ;
@@ -90,15 +91,15 @@ export function initRepoEditor() {
9091 continue ;
9192 }
9293 if ( i < parts . length - 1 ) {
93- if ( value . length ) {
94+ if ( trimValue . length ) {
9495 $ ( `<span class="section"><a href="#">${ htmlEscape ( value ) } </a></span>` ) . insertBefore ( $ ( filenameInput ) ) ;
9596 $ ( '<div class="breadcrumb-divider">/</div>' ) . insertBefore ( $ ( filenameInput ) ) ;
9697 }
9798 } else {
9899 filenameInput . value = value ;
99100 }
100101 this . setSelectionRange ( 0 , 0 ) ;
101- containSpace |= value . trim ( ) !== value ;
102+ containSpace |= ( trimValue !== value && trimValue !== '' ) ;
102103 }
103104 let warningDiv = document . querySelector ( '.ui.warning.message.flash-message.flash-warning.space-related' ) ;
104105 containSpace |= Array . from ( links ) . some ( ( link ) => {
You can’t perform that action at this time.
0 commit comments