1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

fix regex to correctly match the src attribute when there is a data-src attribute

This commit is contained in:
Baptiste Augrain
2018-11-28 15:00:29 +01:00
parent 2908884202
commit c2e4bae9dd

View File

@@ -287,7 +287,7 @@ function handleAttachmentDrop (codeEditor, storageKey, noteKey, dropEvent) {
if (item.type === 'text/html') { if (item.type === 'text/html') {
const html = dropEvent.dataTransfer.getData('text/html') const html = dropEvent.dataTransfer.getData('text/html')
const match = /<img[^>]*src="([^"]+)"/.exec(html) const match = /<img[^>]*[\s"']src="([^"]+)"/.exec(html)
if (match) { if (match) {
const imageURL = match[1] const imageURL = match[1]