Created
January 15, 2019 18:40
-
-
Save qwIvan/8ec83a3b0dc4f599b77eef4585d85451 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://regex101.com/r/yX5xS8/73 | |
const html = ` | |
<ImG | |
sTyle="" | |
src="http://t.cn/EqRt9Eh" | |
class=">" | |
Style="" | |
/> | |
<ImG | |
style="" | |
src="http://t.cn/EqRt9Eh" | |
class=">" | |
STYLE="" | |
> | |
`.replace(/<((?:"[^"]*"['"]*|'[^']*'['"]*|[^'">\/])+)\/?>/gi, '<img style="max-width: 100%" $1 style="max-width: 100%" >'); | |
console.log(html) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment