Skip to content

Instantly share code, notes, and snippets.

/-

Created August 15, 2017 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/e1575625777cbe649383b0eb844dd28c to your computer and use it in GitHub Desktop.
Save anonymous/e1575625777cbe649383b0eb844dd28c to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
package Mojo::ByteStream::Role::Escape;
use Role::Tiny;
use HTML::Entities();
sub html_escape { HTML::Entities::encode_entities(shift) }
1;
package main;
use Mojo::Base -strict;
use Mojo::ByteStream;
warn Mojo::ByteStream->with_roles('Mojo::ByteStream::Role::Escape')->new('All your møøse are belong to me')->html_escape;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment