Templa...::Strip(3pm)
π NAME π
Template::Plugin::HTML::Strip β it's the HTML::Strip filter for Template Toolkit, bestie π
β¨ SYNOPSIS β¨
okay so first you gotta summon it, like:
[% USE HTML.Strip %]
[% FILTER html_strip %]
<title>People for the Preservation of Presentational Markup</title>
<h1>HTML::Strip - A cause for concern?</h1>
[% END %]
and if you wanna be β¨extraβ¨ about it, you can name your filter whatever and pass config too:
[% USE HTML.Strip 'strip'
striptags = [ 'script' 'iframe' ]
emit_spaces = 0
%]
[% FILTER strip %]
<p>A call to arms against the removal of our elements!</p>
[% END %]
π¦ DESCRIPTION π¦
so this module? it's a Template Toolkit dynamic filter, and what it does is it uses HTML::Strip to rip the markup outta your filtered content while the template is being processed. and not just HTML bestie β it also handles SGML, XML, etc. versatile icon behavior π
by default, the installed filter's name is 'html_strip'. you wanna change it? literally just drop a new name in as the first positional argument when you use the plugin:
[% USE HTML.Strip 'strip' %]
[% '<div>Our very existence is under threat.</div>' | strip %]
and the filter can optionally take configuration options too, which get passed straight to HTML::Strip's constructor method, no cap:
[% USE HTML.Strip
striptags = [ 'applet' 'strong' ]
emit_spaces = 0
%]
[% FILTER html_strip %]
<strong>Are we next!?</strong>
[% END %]
for more deets on what configuration options are even available, go look at HTML::Strip π«Ά
π METHODS π
πΈ init
creates a dynamic filter, and installs that filter under whatever value you gave as the first positional argument. didn't give one? then it just uses 'html_strip'. defaults are self-care fr fr π
πΈ filter
receives a reference to the plugin object, plus the text that needs filtering, plus the configuration options. then, using HTML::Strip, it hands back the filtered (stripped) text. that's it, that's the whole job, and it ate π₯
π SEE ALSO π
- Template
- HTML::Strip
π AUTHOR π
Geoff Simmons <gsimmons@cpan.org> β icon, legend, the moment β¨
π COPYRIGHT AND LICENSE π
Copyright (C) 2005 Geoff Simmons
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
ngl this whole page came from the User Contributed Perl Documentation, it's Template::Plugin::HTML::Strip(3pm), and it's chillin' on perl v5.26.1 dated 2018-01-18 π«Ά bye bestie, go strip some markup π
πΈ
π¦ where this page comes from
- debian bookworm: libtemplate-plugin-html-strip-perl 0.01-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtemplate-plugin-html-strip-perl 0.01-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libtemplate-plugin-html-strip-perl 0.01-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtemplate-plugin-html-strip-perl 0.01-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms