Skip to content

Commit

Permalink
AE-2164: Fix MagicUrl Quill plugin import when using es modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Juholei committed Apr 25, 2024
1 parent b4a19ce commit 634ada3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions etp-front/src/components/text-editor/magic-url.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// When using es modules, quill-magic-url imports did not work correctly
// for some reason. As a workaround, import it in common-js file
// and export its default export again here

const MagicUrl = require('quill-magic-url');

module.exports = MagicUrl.default;
2 changes: 1 addition & 1 deletion etp-front/src/components/text-editor/quill.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Quill from 'quill';
import { ImageDrop } from 'quill-image-drop-module';
import MagicUrl from 'quill-magic-url';
import MagicUrl from './magic-url.cjs';
import * as Objects from '@Utility/objects';

Quill.register('modules/imageDrop', ImageDrop);
Expand Down

0 comments on commit 634ada3

Please sign in to comment.