I think I understand now :) You're looking for the last 10% of "legal html" or as close as you can get and still be good html... 1, you'd still have to parse to be sure the html is good.. let's try this.. We'll make yer html string a bit longer..

"<font face='verdana'><b>hello world</b></font>
<br><i>abc123<br>hi again world<br></i><font face='verdana'>
<b>hello world</b></font><br><i>abc123<br>hi again world<br></i>
<i>abc123<br>hi again world<br></i><font face='verdana'>
<b>hello world</b></font><br><i>abc123<br>hi again world<br></i>"

ok, I'm not gonna calculate what the last 10% of that string is, I'll just
grab a small section at the end..

"llo world</b></font><br><i>abc123<br>hi again world<br></i>"

We'll call that 10% for the sake of argument..  Now what you'd be looking
for out of that would be: "<br><i>abc123<br>hi again world<br></i>"

no?  Am I getting it right now?  the leading <br> would be considered legal
so we'd leave it in? but the "llo world</b></font>" should either be left out,
or we need to back up to include the "<font face...".

I have a couple of ideas, but I'd need to test them..  The real question is,
am I understanding now?










----- Original Message ----- From: "Jayson K Hanes" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <[email protected]>
Sent: Tuesday, January 17, 2006 5:14 PM
Subject: RE: [Flashcoders] efficient htmltext.reduce() function? orsimilaridea?


Thanks for your detailed effort, Julius, but, I'm afraid you do not
understand.

I need to be able to arbitrarily truncate and html string to maintain a
stable length, without damaging the html to the point of mucking up
flash's ability to render it.

I don't want to strip anything, I need to remove old collections of the
html data safely.

-Jayson

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Julius - XK
Sent: Tuesday, January 17, 2006 4:45 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] efficient htmltext.reduce() function?
orsimilaridea?

Why not just strip out tags ya don't need?  Using regex strip out
all "<font*>" and "</font>" and/or the "<b></b>" and "<i></i>"
stuff..  When I first started reading this thread I was thinking along
the lines of real optomizing..  Say ya got:
"<font face='verdana'><b><i>some <font
face='verdana'><b>text</b></font>
</i></b></font>"
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to