Skip to content

Commit c540f9f

Browse files
committed
Fix check for Prosemirror editor
Fixes #35
1 parent 8a7fdd6 commit c540f9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
* @param {string} id The newly uploaded file ID
8383
*/
8484
function insertSyntax(id) {
85-
if (proseMirrorIsActive) {
85+
if (typeof window.proseMirrorIsActive !== 'undefined' && window.proseMirrorIsActive === true) {
8686
const pm = window.Prosemirror.view;
8787
const imageNode = pm.state.schema.nodes.image.create({id: id});
8888
pm.dispatch(pm.state.tr.replaceSelectionWith(imageNode));

0 commit comments

Comments
 (0)