File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ jQuery(function () {
6363 appendTo : '.dokuwiki' ,
6464 modal : true ,
6565 open : function ( ) {
66- const ns = isMMPage ? jQuery ( '.panelHeader h3 strong' ) . text ( ) : jQuery ( '#media__ns' ) . text ( ) ;
66+ const nsText = isMMPage ? jQuery ( '.panelHeader h3 strong' ) . text ( ) : jQuery ( '#media__ns' ) . text ( ) ;
67+ const ns = cleanNs ( nsText ) ;
6768 jQuery ( '#diagrams__current-ns' ) . text ( ns ) ;
6869 } ,
6970 close : function ( ) {
Original file line number Diff line number Diff line change @@ -11,6 +11,14 @@ function validId(id) {
1111 return id . length > 0 && / ^ [ \w ] [ \w \. \- ] * $ / . test ( id )
1212}
1313
14+ /**
15+ * Media Manager encloses the root dir in [] so let's strip that
16+ * because it is not a real namespace
17+ */
18+ function cleanNs ( text ) {
19+ return text . replace ( / ^ \[ .* \] $ / , '' ) ;
20+ }
21+
1422/**
1523 * return URL of an existing diagram
1624 *
You can’t perform that action at this time.
0 commit comments