iphone - How to search and correct html tags and attributes? -
In my application, I have the litter to fix all the closing tags of and; Img & gt;
tag as shown below & lt; Img & gt;
& gt; Instead of closing it with
, it should be closed with />
.
All & lt; Img & gt;
to search for and & gt;
(If this is not an action already required by an />
).
Any other questions, if & lt; Img & gt; There is no width or height for
Specified, what is the best way to solve this problem?
Download all images and get related features of width and height, then add them back to the string?
Correct & lt; Img & gt; The
tag is the one that closes with /> and
and has a valid width; . Height
& lt; A href = "http://www.cultofmac.com/daily-deals749-mac-mini-1199-3-0ghz-imac-new-mac-pros/ 52,674" & gt; & Lt; Img align = "left" hspace = "5" width = "150" src = "http://s3.dlnws.com/images/products/images/749000/749208-large" alt = "" title = "" & Gt; & Lt; / A & gt; Today, Apple has provided a lot of resources to the people, including the introduction of iMac and Mac professionals with a new processor and enhanced storage options. We have today's deals, as well as many more items for Mac Lovers. With the latest line of iMacs and Mac professionals, we will also look at a number of software deals [...] & lt; P & gt; & Lt; "A href = http://feedads.g.doubleclick.net/~ A / DL_-gOGSR1JMzKDbErt1EG3re3I / 0 / da" & gt; & Lt; Img src = "http://feedads.g.doubleclick.net/~a/DL_-gOGSR1JMzKDbErt1EG3re3I/0/di" range = "0" ismap> & Lt; / A & gt; & Lt; Br> & Lt; A href = "http://feedads.g.doubleclick.net/~a/DL_-gOGSR1JMzKDbErt1EG3re3I/1/da" & gt; & Lt; Img src = "http://feedads.g.doubleclick.net/~ A / DL_-gOGSR1JMzKDbErt1EG3re3I / 1 / di" range = "0" ismap> & Lt; / A & gt; & Lt; / P & gt; & Lt; Img src = "http://feeds.feedburner.com/~r/cultofmac/bFow/~ 4/Mq5iLOaT50k" height = "1" width = "1" & gt; After text, "text" itemprop = "text"> Regular expressions will solve the problem with your tag shutting down correctly - ensure that
Make sure that you're using whatever search for 'your code search' supports regular expressions, and then search for something like this (assuming that all of your open image tags end with a " >):
and replace with:\ & lt; img (.? *) "\ & Gt;
& lt; Img $ 1 "/>
As far as a bit about the width and height characteristics, if you are trying to display the images at their regular width and height You should not need them. Only once you need width and height, you can see the image different size than the size of the original image, which does not appear here.
Comments
Post a Comment