|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hi,
I'm writing a Palm Pilot portal that allows users to see the Palm Pilotized version of any website. Basically, they input a URL and ALL HTML tags except for <br>,<p>, and <a...></a> get stripped. What I'm doing now is this: $content = get $url; #$content =~ s/<style.*?/style>//gi; #$content =~ s/<!.*?>//gi; #$content =~ s/<br>/--break--/gi; #$content =~ s/<p>/--break-- --break--/gi; #$content =~ s/<a/--startlink--/gi; #$content =~ s/</a>/--endlink--/gi; #$content =~ s/<.*?>//g; #$content =~ s/--startlink--/<a/gi; #$content =~ s/--endlink--/</a>/gi; #$content =~ s/--break--/<br>/gi; but the problem I run into w/ that is that the stuff between style and script tags isn't being removed and it doesn't really look good. Any suggestions? -Intaglio |
|
#2
|
|||
|
|||
|
remember that . matches everything except newline characters, so, it may be that it's not getting stripped for that reason.
|
|
#3
|
|||
|
|||
|
Instead of /gi, use /gis and newlines will be included.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Stripping HTML tags of an external site |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|