Internet Explorer will often add this to an image tag:
style="WIDTH: 432px; HEIGHT: 344px"
when an image is resized via drag in the editor. The values contained within the style are the correct ones resulting from the drag and override the standard height= and width= parameters still remaining in the image tag which are incorrect (after the drag resize).
I am seeking a regex that will read the values within the style parameter, remove the style parameter, and leaving everything else the same rewrite the tag with assignment of the values within the style to the standard width= and height= parameters. For example, change this:
<IMG style="WIDTH: 432px; HEIGHT: 344px" height=442 hspace=10 src='http://theimgurl/filename.jpg" width=612 align=middle vspace=10 border=0>
to this:
<IMG height=344 hspace=10 src='http://theimgurl/filename.jpg" width=432 align=middle vspace=10 border=0>
Will that be possible? It seems like it would be a very complex regex well beyond my skills and brainpower.
The purpose is that under certain circumstances the presence of the style breaks page layouts in older browsers. I'm not sure, but also if a browser does not have styles on then the image would appear in the unintended size, right?
Thanks!
Rob
Fri, 03/18/2005 - 09:35
#1