This content has been marked as final. Show 11 replies
Try using a regular expression. Though not the best, something along these lines
Ok can you step me through that?
The function uses 4 parameters:
reFindNoCase( theRegularExpression, theString, startAtCharacter, returnSubExpressions)
If you break down the regular expression <img[^>]+>:
The first part finds the start of an image tag: <img
Followed by one or more characters that are not the closing tag: [^>]+
Followed by the closing tag: >
When you set returnSubExpressions to true, the result is an array containing the starting position and length of the matched string: ie result.pos and result.len. You can use those values, with the MID function, to obtain the matched substring.
<cfset matchedSubstring = Mid(chunkOfHTML, result.pos, result.len)>
How do I output the variable the has the html stored so the browser interprets it as the actual html instead of just outputting the literal value.
Just remove the <pre> tags and HTMLEditFormat and it should behave as html.
How about this one?
I am pulling in a friend's forum rss feed and we are trying to figure out how to make images display correctly. When people post images on his forum, they don't post correctly when I pull the feed. Here is a sample chunk that I pull in:
I am posting a forum image here... Image: http://mysite/test.jpg
How would I be able to make the "Image: http://mysite/test.jpg" update to <img src=" http://mysite/test.jpg">
Sorry I did not respond. The forums appeared to be down. Did you get this sorted out yet?
(Btw, you have PM disabled)
I finally just buckled down and read some tutorials about it. I am getting a decent grasp on it, but still have some trouble translating some of the more advanced regex code. I will enable PM.