use parent qw(Text::MultiMarkdown);
-@Bugzilla::Markdown::EXPORT = qw(new);
-
# Regex to match balanced [brackets]. See Friedl's
# "Mastering Regular Expressions", 2nd Ed., pp. 328-331.
our ($g_nested_brackets, $g_nested_parens);
}x;
our %g_escape_table;
-my @code_blocks;
foreach my $char (split //, '\\`*_{}[]()>#+-.!~') {
$g_escape_table{$char} = md5_hex($char);
return $self->SUPER::_Markdown($text, @_);
}
+sub _code_blocks {
+ my ($self) = @_;
+ $self->{code_blocks} = $self->{params}->{code_blocks} ||= [];
+ return $self->{code_blocks};
+}
+
sub _RunSpanGamut {
# These are all the transformations that occur *within* block-level
# tags like paragraphs, headers, and list items.
)
`{3,} [\s\t]* $
}{
- push @code_blocks, $1;
+ push @{$self->_code_blocks}, $1;
"%%%FENCED_BLOCK%%%";
}egmx;
return $text;
$text =~ s{
^ %%%FENCED_BLOCK%%%
}{
- my $codeblock = shift @code_blocks;
+ my $codeblock = shift @{$self->_code_blocks};
my $result;
$codeblock = $self->_EncodeCode($codeblock);