http://qs321.pair.com?node_id=11119968


in reply to Re^2: Looking for a module that strips an HTML tag and its associated 'TEXT'
in thread Looking for a module that strips an HTML tag and its associated 'TEXT'

quite the dependency chain you added just for this.

Replies are listed 'Best First'.
Re^4: Looking for a module that strips an HTML tag and its associated 'TEXT'
by nysus (Parson) on Jul 29, 2020 at 13:56 UTC

    It turns out it doesn't even do what I need. And now I just tried https://metacpan.org/pod/HTML::Scrubber and it doesn't seem to work, either.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
    $nysus = $PM . ' ' . $MCF;
    Click here if you love Perl Monks

        I want the code to pass these simple tests:

        # eliminate_tags is(eliminate_tags("url: <a href=\"http://example.com/\">http://example +.com/</a>", 'a'), "url: "); is(eliminate_tags("<div>\n <p>hoge foo.</p>\n <p>bar tarao.</p>\n</d +iv>", 'p'), "<div>\n \n \n</div>"); # eliminate_links is(eliminate_links("url: <a href=\"http://example.com/\">http://exampl +e.com/</a>"), "url: "); is(eliminate_links("<div>\n <p>hoge foo.</p>\n <p>bar tarao.</p>\n</ +div>"), "<div>\n <p>hoge foo.</p>\n <p>bar tarao.</p>\n</div>");

        $PM = "Perl Monk's";
        $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
        $nysus = $PM . ' ' . $MCF;
        Click here if you love Perl Monks