Quill: insertEmbed and pasteHTML can't use relative paths to images in Electron

Created on 28 Aug 2016  路  2Comments  路  Source: quilljs/quill

Previously you could use insertEmbed and a relative file path to insert an image. For apps built locally like in Electron this was very useful. Now it appears the clipboard is sanitizing these relative paths.

Steps for Reproduction

  1. try to programactically insertEmbed with image type and relative filepath
  2. observe that the src attribute is '//:0'

Expected behavior: the image is embedded within the editor

Actual behavior: you get a blank space

Platforms: Electron 1.2.4

Version: V1-rc

Most helpful comment

You can customize the Image Blot's sanitizer:

var ImageBlot = Quill.import('formats/image');
ImageBlot.sanitize = function(url) {
  return url;  // No sanitization
};

All 2 comments

You can customize the Image Blot's sanitizer:

var ImageBlot = Quill.import('formats/image');
ImageBlot.sanitize = function(url) {
  return url;  // No sanitization
};

Awesome thank you!

Was this page helpful?
0 / 5 - 0 ratings