striptag

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dan Jacobson

    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(*ST DIN);
  • Himanshu Garg

    #2
    Re: striptag

    Dan Jacobson <jidanni@jidann i.org> wrote in message news:<87d66mm44 e.fsf@jidanni.o rg>...[color=blue]
    > 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(*ST DIN);[/color]

    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

    Comment

    • gnari

      #3
      Re: striptag

      "Himanshu Garg" <himanshu@gdit. iiit.net> wrote in message
      news:a46e54c7.0 404052347.2bea8 962@posting.goo gle.com...[color=blue]
      > Dan Jacobson <jidanni@jidann i.org> wrote in message[/color]
      news:<87d66mm44 e.fsf@jidanni.o rg>...[color=blue][color=green]
      > > 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.[/color][/color]
      Help.[color=blue][color=green]
      > > $ cat striptag
      > > use strict;
      > > use HTML::Parser;
      > > my $parser = HTML::Parser->new( text_h => [ sub { print[/color][/color]
      shift; },"dtext" ]);[color=blue][color=green]
      > > $parser->parse_file(*ST DIN);[/color]
      >
      > 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.[/color]

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

      gnari



      Comment

      • Dan Jacobson

        #4
        Re: striptag

        OK, done: http://jidanni.org/comp/striptag
        striptag -- strip given tags out of HTML
        Usage example: striptag font div < file.html

        Comment

        • Dan Jacobson

          #5
          Re: striptag

          OK, done: http://jidanni.org/comp/striptag
          striptag -- strip given tags out of HTML
          Usage example: striptag font div < file.html

          Comment

          Working...