lib/Rapi/Blog/Template/Postprocessor/TextMarkdown.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 23 CC 2 SCAR 12.0
CC
2
Cov
0%
process
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.3
1 package Rapi::Blog::Template::Postprocessor::TextMarkdown;
2 use strict;
3 use warnings;
4
5 use RapidApp::Util qw(:all);
6 use Text::Markdown 'markdown';
7
8 # This post-processor converts markdown to html using the native perl
9 # Text::Markdown package. The benefit of this is that the conversion
10 # happens on the server-side, and doesn't rely on client-side javascript.
11 # However, it doesn't do nearly as good a job as marked.js, which is used
12 # by the default post-processor MarkdownElement.
13
14 sub process {
15 shift if ($_[0] eq __PACKAGE__);
16 my ($output_ref, $context) = @_;
17
18 return markdown($$output_ref);
19 }
20
21
22 1;