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:
@@ -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]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user