Hey there.
I want my forum to convert urls ending in gif,png,jpg/jpeg to be converted into [ img ] tags
User
Crazycat helped me with the following code:
Regular expression:
(https?://[^ ]+\.(png|gif|jpeg|jpg))
<a href="$1"><img src="$1" /></a>
but now i got this:
how can i fix this? is it something about the theme im using?
Have you tried the Default theme?
You'd better provide us your forum url and a test account
Well, I understand the trouble: it breaks images wich are included with mycode because the custom mycode is applyed after the message parsing.
Change the regular expression to [^"](https?://[^ ]+\.(png|gif|jpeg|jpg))
This is exactly what happens when you view a page that used the old method of manually coding the img tags. The mycode sees the URL and adds another set of tags. You are seeing the results of a double-tagged image.
[
attachment=44123]
Works on my dev forum. But if you disable the MyCode, I can't see what happens on your forum.
@zeus1921: Ctrl-F5 to refresh browser if needed.
@Crazycat
not sure if you can have one *and* the other. At least not here.
Good reference here.
https://regex101.com/
Post with this content doesn't work completely. I've run out of time to continue testing.
https://www.thetreecenter.com/wp-content/uploads/variegated-liriope-2.jpg
[img]https://www.thetreecenter.com/wp-content/uploads/variegated-liriope-2.jpg[/img]