A quill plugin to deal with pasting and droping images and html including images. Example.
npm i -S quill2-image-drop-and-paste
import Quill from 'quill';
import Quill2ImageDropAndPaste from 'quill2-image-drop-and-paste';
Quill.register('modules/imageDropAndPaste', Quill2ImageDropAndPaste);
const quill = new Quill('#editor-container', {
modules: {
// ...
imageDropAndPaste: {
upload: uploadImage,
imageDomainAllowList: [
'cdn.nlark.com'
],
imageAllowMatch(url: string) {
},
},
history: {
userOnly: true, // Recommend to turn on this option
},
// ...
},
});
function uploadImage(file: Blob, originalUrl: string): string {
}
npm lint
: Eslint codenpm lint:fix
: Eslint code and try to fix problemsnpm start
: Realtime complie codenpm run docs
: Generate type documentsnpm run build
: Build ths dist productsnpm run release
: The same as npm run release:patch
npm run release:patch
: Automatically upgrade patch versioin and update CHANGELOG.mdnpm run release:minor
: Automatically upgrade minor versioin and update CHANGELOG.mdnpm run release:major
: Automatically upgrade major versioin and update CHANGELOG.mdnpm run test
: Run test suite via jest with code coveragenpm run test:watch
: Run test suite in interactive watch modenpm run test:prod
: Run linting and generate coveragenpm run deploy
: Deploy github pagesnpm install
npm start
cd examples/react-demo
npm install
npm link ../../
npm start
npm run build
npm publish
Generated using TypeDoc