How to add element to the list of adjacent images?
There’s a few problems here. Your regex is pretty broken. You should be using a tool like regex101 to test that. I think for your first function you need to add the possibility of newlines between the image tags like so: /(<img.*?>\r?\n?){2,}/ You can add * before the ?‘s if you want to grab multiple … Read more