Created
May 23, 2022 15:23
-
-
Save SebbeJohansson/3444408646d95383b75434c61c46933c to your computer and use it in GitHub Desktop.
This file contains 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
const regex = /(?<start><img)(?<middle>.*?)(?<end>\/>)/ig; | |
const newText = col.RichText.replaceAll(regex, (match, p1, p2, p3, offset, string, namedGroups) => { | |
return `${namedGroups.start} loading="lazy" ${namedGroups.middle} ${namedGroups.end}`; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment