Skip to content

Instantly share code, notes, and snippets.

@cognominal
Created December 4, 2015 18:49
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 cognominal/c7c21d63649e6c5bfcc5 to your computer and use it in GitHub Desktop.
Save cognominal/c7c21d63649e6c5bfcc5 to your computer and use it in GitHub Desktop.
superseding .print
use MONKEY-TYPING;
supersede class IO::Handler {
my %escape = < \< &lt \> &gt >;
multi method print(IO::Handle:D: Str:D \x --> True) {
my &line = { "<div><$_></div></br>" }
[~] x.lines.map: { line [~] .comb.map: %escape{$_} // * }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment