File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 8282 * @param {string } id The newly uploaded file ID
8383 */
8484 function insertSyntax ( id ) {
85+
86+ // TODO remove the "if" check after LinkWizard.createRelativeID() is available in stable (after Kaos)
87+ if ( typeof LinkWizard !== 'undefined' && typeof LinkWizard . createRelativeID === 'function' ) {
88+ id = LinkWizard . createRelativeID ( JSINFO . id , id ) ;
89+ } else {
90+ id = ':' + id ;
91+ }
92+
8593 if ( typeof window . proseMirrorIsActive !== 'undefined' && window . proseMirrorIsActive === true ) {
8694 const pm = window . Prosemirror . view ;
8795 const imageNode = pm . state . schema . nodes . image . create ( { id : id } ) ;
8896 pm . dispatch ( pm . state . tr . replaceSelectionWith ( imageNode ) ) ;
8997 } else {
90- insertAtCarret ( 'wiki__text' , '{{: ' + id + '}}' ) ;
98+ insertAtCarret ( 'wiki__text' , '{{' + id + '}}' ) ;
9199 }
92100 }
93101
You can’t perform that action at this time.
0 commit comments