Mason:...ilters(3pm)

πŸ“¦
version 0.03 Β· 2 versions
  • 0.03 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.03 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Mason::Plugin::HTMLFilters β€” the manual, but make it cute πŸ’–

Perl User Contributed Documentation ✨ this one's Mason:...ilters(3pm), bestie, and it's literally all about the filters that handle HTML generation for you πŸŽ€


🌸 NAME 🌸

Mason::Plugin::HTMLFilters β€” filters related to HTML generation πŸ¦‹


✨ FILTERS ✨

Okay so here's the whole squad of filters. Pick your fighter πŸ’…

HTML or H

Does a basic HTML escape on the content β€” and when I say basic I mean it's only touching these four characters and nothing else: '&', '>', '<', and '"'. That's it. That's the whole list 🫢

<input name="company" value="<% $company | H %>">

HTMLEntities

This one does the comprehensive HTML escape on your content, using HTML::Entities::encode_entities. So if H is the girl who does the bare minimum, HTMLEntities is the one who did the reading πŸ˜­πŸ’–

URI or U

URI-escapes the content, periodt πŸ”₯

<a href="<% $url | U %>">

HTMLPara

Takes a block of text and formats it into HTML paragraphs 🧚 A sequence of two or more newlines is the delimiter for paragraphs, and each one gets wrapped in HTML "<p>"..."</p>" tags. This one's taken from Template::Toolkit. e.g. πŸ‘‡

% $.HTMLPara {{
First paragraph.

Second paragraph.
% }}

outputs:

<p>
First paragraph.
</p>

<p>
Second paragraph.
</p>

HTMLParaBreak

Basically HTMLPara from above but make it different πŸ’« β€” instead of <p> tags it uses the HTML tag sequence "<br><br>" to join paragraphs together. Also taken from Template::Toolkit. e.g.:

% $.HTMLPara {{
First paragraph.

Second paragraph.
% }}

outputs:

First paragraph.
<br><br>
Second paragraph.

FillInForm ($form_data, %options)

Uses HTML::FillInForm to fill in the form with the $form_data and %options you hand it. Filling out forms? Not on your watch, bestie πŸ™ˆβœ¨

% $.FillInForm($form_data, target => 'form1') {{
...
<form name='form1'>
...
% }}

🫢 SUPPORT 🫢

The mailing list for Mason and Mason plugins is mason-users@lists.sourceforge.net. Heads up though: you must be subscribed to send a message. To subscribe, go visit <https://lists.sourceforge.net/lists/listinfo/mason-users> πŸ’Œ

You can also come hang out with us in "#mason" on <irc://irc.perl.org/#mason> πŸ‘‘

Bugs and feature requests get tracked at RT:

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Mason-Plugin-HTMLFilters
bug-mason-plugin-htmlfilters@rt.cpan.org

The latest source code can be browsed and fetched at:

http://github.com/jonswar/perl-mason-plugin-htmlfilters
git clone git://github.com/jonswar/perl-mason-plugin-htmlfilters.git

πŸ‘€ SEE ALSO πŸ‘€

Mason


perl v5.34.0 Β· 2022-05-27 β€” that's the version and the date, babes, and that's a wrap on the HTMLFilters page πŸ’…πŸŒΈ no cap, you're gonna slay those forms πŸŽ€

πŸ“¦ where this page comes from