473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

striptag

This used to strip only the given tags:
$ striptag font div < file.html
but now it strips all tags. Something must have changed on my system. Help.
$ cat striptag
use strict;
use HTML::Parser;
my $parser = HTML::Parser->new( text_h => [ sub { print shift; },"dtext" ]);
$parser->parse_file(*STDIN);
Jul 20 '05 #1
4 3295
Dan Jacobson <ji*****@jidanni.org> wrote in message news:<87************@jidanni.org>...
This used to strip only the given tags:
$ striptag font div < file.html
but now it strips all tags. Something must have changed on my system. Help.
$ cat striptag
use strict;
use HTML::Parser;
my $parser = HTML::Parser->new( text_h => [ sub { print shift; },"dtext" ]);
$parser->parse_file(*STDIN);


You probably deleted the code that handles the command line arguments.
Nowhere do I see special handling of ARGV which in this case is font
and div.

++imanshu
Jul 20 '05 #2
"Himanshu Garg" <hi******@gdit.iiit.net> wrote in message
news:a4**************************@posting.google.c om...
Dan Jacobson <ji*****@jidanni.org> wrote in message

news:<87************@jidanni.org>...
This used to strip only the given tags:
$ striptag font div < file.html
but now it strips all tags. Something must have changed on my system. Help. $ cat striptag
use strict;
use HTML::Parser;
my $parser = HTML::Parser->new( text_h => [ sub { print shift; },"dtext" ]); $parser->parse_file(*STDIN);


You probably deleted the code that handles the command line arguments.
Nowhere do I see special handling of ARGV which in this case is font
and div.


or more likely, you have another version of the script lying around,
that deals with the tag selection.

gnari

Jul 20 '05 #3
OK, done: http://jidanni.org/comp/striptag
striptag -- strip given tags out of HTML
Usage example: striptag font div < file.html
Jul 20 '05 #4
OK, done: http://jidanni.org/comp/striptag
striptag -- strip given tags out of HTML
Usage example: striptag font div < file.html
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.