mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Re: $htmlfree update needed [Re: jaytea] #209710 21/02/09 04:44 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
That works almost perfectly, jaytea. It doesn't remove & nbsp;, but it does make the line look right. I can more easily handle those non-breaking spaces than the other, even right within the identifier. It is all working great now. Thanks.

Mpdreamz, as you said yourself, it affects performance to jump into COM for something so minor as HTML removal. I do use COM in other scripts, but it's used in cases where there really isn't a better option to get the information that it provides (such as system or Windows information). That said, a DLL would probably still be better in those cases, but I understand COM... I don't really want to try to figure out how to write DLLs right now.

Also, as genius_at_work said, this problem for me gives the option to try and fix the often-used $htmlfree/$nohtml identifiers so they work in more situations. It's much easier for someone to use a widely used HTML removal identifier than to try and find a COM script that does exactly what they need. I admit I wasn't trying to fix it for anyone else, but it's not a bad idea to do so.

So I wasn't ignoring your suggestion. I just felt that I could have less of a performance problem using other methods. I didn't benchmark yours versus others, so maybe it isn't slower than other methods... it just seems like it would be.


Invision Support
#Invision on irc.irchighway.net
Re: $htmlfree update needed [Re: Riamus2] #209718 21/02/09 06:44 PM
Joined: Apr 2004
Posts: 759
M
Mpdreamz Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
Hehe i havent done any benchmarking myself but i doubt the endresult will be slower then the equivalent regex call. Which is not the one that jaytea posted which needs balanced brackets. Like i mentioned in my post PCRE recursion could get you there halfway. But then thats PCRE's awesomeness overcomming some Turing Completeness issues with regex.

If someone gets it working for nested tags and unbalanced (which they wont) i'll take up the challange with the COM solution.

Regex does not equal fast per se definatly not complex ones like the one is needed here, much like COM which doesnt have to be slow per se. Replying here makes me very curious how fast/slow the com approach will be so i'll do some benchmarking tomorrow laugh

Not to say an updated $htmlfree which handles nested balanced tags however wrong though is a bad thing :P (oxymoron ?)(Alias should really be called $striphtml or something btw come to think of it).

Glad jaytea's solution works for you smile



Last edited by Mpdreamz; 21/02/09 06:46 PM.

$maybe
Re: $htmlfree update needed [Re: Mpdreamz] #209719 21/02/09 07:01 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Page 2 of 2 1 2