diff --git a/index.js b/index.js
index 09fcb0f..9c2fb02 100644
--- a/index.js
+++ b/index.js
@@ -133,9 +133,9 @@ export default async function now() {
`$1${latest.image}$2`,
)
} else {
- // remove img tags if no image available (handle multi-line tags)
+ // remove img tags if no image available (handle multi-line tags and any attribute order)
newNow = newNow.replace(
- new RegExp(`
]*src=["']${imageId}["'][^>]*>`, 'gis'),
+ new RegExp(`
]*\\bsrc=["']${imageId}["'][^>]*>`, 'gis'),
'',
)
// remove markdown image
@@ -154,7 +154,7 @@ export default async function now() {
} else {
// remove video tags if no video available
newNow = newNow.replace(
- new RegExp(``, 'gi'),
+ new RegExp(``, 'gis'),
'',
)
}