Image Size & Align Help
#1
I'm trying to create an expression that allows users to size and align an image in the same instance.

Regular Expression:
\[img width=(.*?) align=(left|center|right)\](.*?)\[/img\]

Replacement:
<img src="$3" width="$1" align="$2" />

When I insert the mycode as such:
[img width=100 align=right]IMG URL HERE[/img]

Everything looks great. It works. Awesome.

When I go back to edit my post, I see this:
[img=100x100]IMG URL HERE[/img]

For some reason, the align is getting dropped and the width is becoming something else.

What am I missing here?
Reply
#2
I guess because IMG mycode is assigned as non editable default MyBB MyCode you can give it different expression to check is it really working.
[Image: cafaf18ba2.gif]
FileSquid is under development
[Image: trk1]
Reply
#3
Switching it over to be "image" instead of "img" helped retain the styling! Thank you.
Reply
#4
weird, the custom one is supposed to override the default
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)