nysus has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to make use of the bit flags documented at Text::Markdown::Hoedown. I've got the following function, which works, except for the extensions value. I don't know what I'm doing there.
package Dancer2::Plugin::MarkdownFilesToHTML::MarkdownParser ; use strict; use warnings; use parent qw(Exporter); our @EXPORT = qw( markdown ); use XSLoader; XSLoader::load('Text::Markdown::Hoedown', '1.02'); sub markdown { my $str = shift; my %args = ( html_options => 0, extensions => '| HOEDOWN_EXT_FENCED_CODE', max_nesting => 16, toc_nesting_lvl => 99, @_, ); my $renderer = Text::Markdown::Hoedown::Renderer::HTML->new( $args{html_options}, $args{toc_nesting_lvl}, ); my $md = Text::Markdown::Hoedown::Markdown->new( $args{extensions}, $args{max_nesting}, $renderer ); return $md->render($str); }
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do you pass bit flag arguments?
by choroba (Cardinal) on Nov 05, 2018 at 21:16 UTC | |
by nysus (Parson) on Nov 05, 2018 at 21:23 UTC |