mIRC Home    About    Download    Register    News    Help

Print Thread
#163961 06/11/06 01:13 PM
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
Hi, I am having a little trouble here. I am trying to modify this $nohtml code:
Code:
alias nohtml {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
  return %x
}

to replace the <br> html tag with either a line feed or a null space or something instead of just removing it cause when I use just the nohtml alias alone, it just removes the <br> tag and the paragraphs all run together instead of having a line between them.

this is what i have so far but it won't replace the <br> tag. can someone tell me what i am doing wrong, and fix my code: :

Code:
alias nohtml2 {
  var %br, %i
  %br = $replace($1-,&lt;br&gt;,$null)
  %i = $regsub(%br,/(^[^&lt;]*&gt;|&lt;[^&gt;]*&gt;|&lt;[^&gt;]*$)/g,$null,%x)
  return %x
}

Any help would be very much appreciated.....thanks


keek: Scots - intr.v. keeked, keekĀ·ing, keeks
To peek; peep.
#163962 06/11/06 03:12 PM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Your code replaces <br> with "" (nothing). If you are writing the html string to a file, you can get a linefeed by using $crlf instead of $null. If you are writing the html string into mIRC somewhere (window), you can get a space by using $chr(32) instead of $null.

-genius_at_work

#163963 07/11/06 01:12 AM
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
thanks for the reply genius_at_work, but i was getting so frustrated and confused i went a different way, i just read the part of the page that i wanted directly into a file without running it through $nohtml and removed <br>'s when i filtered it to a @window.


thanks again


keek: Scots - intr.v. keeked, keekĀ·ing, keeks
To peek; peep.

Link Copied to Clipboard