package LDV::Helpers; use strict; use warnings; use utf8; use Mojo::Base 'Mojolicious::Plugin'; use Text::Markdown; sub register { my ($self, $app) = @_; $app->helper(markdown => sub { my ($c, $text) = @_; my $render = Text::Markdown->new; return $render->markdown($text); }); $app->helper(plaintext => sub { my ($c, $text) = @_; $text =~ s{\r?\n}{
}go; return $text; }); } 1;