use regex for finding img where src is a blob

This commit is contained in:
Nathan Woulfe
2019-10-02 19:18:26 +10:00
committed by Sebastiaan Janssen
parent d7b25fc4dc
commit 8d3b74fbec

View File

@@ -1346,8 +1346,9 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
var content = e.content;
// Upload BLOB images (dragged/pasted ones)
if(content.indexOf('<img src="blob:') > -1){
// find src attribute where value starts with `blob:`
// search is case-insensitive and allows single or double quotes
if(content.search(/src=["']blob:.*?["']/gi) !== -1){
args.editor.uploadImages(function(data) {
// Once all images have been uploaded
data.forEach(function(item) {