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 82
82
* @param {string } id The newly uploaded file ID
83
83
*/
84
84
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
+
85
93
if ( typeof window . proseMirrorIsActive !== 'undefined' && window . proseMirrorIsActive === true ) {
86
94
const pm = window . Prosemirror . view ;
87
95
const imageNode = pm . state . schema . nodes . image . create ( { id : id } ) ;
88
96
pm . dispatch ( pm . state . tr . replaceSelectionWith ( imageNode ) ) ;
89
97
} else {
90
- insertAtCarret ( 'wiki__text' , '{{: ' + id + '}}' ) ;
98
+ insertAtCarret ( 'wiki__text' , '{{' + id + '}}' ) ;
91
99
}
92
100
}
93
101
You can’t perform that action at this time.
0 commit comments