summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authorIsrael Madueme <purelogiq@gmail.com>2018-06-15 23:42:19 +0200
committerDylan William Hardison <dylan@hardison.net>2018-06-15 23:42:19 +0200
commit170ec08234e29050c5d78d52e4100207625897d2 (patch)
tree14e8abc9e746dc30f42527b024d85b64f474e001 /Bugzilla.pm
parent404dc5496967203c5f99755340f43d712420446a (diff)
downloadbugzilla-170ec08234e29050c5d78d52e4100207625897d2.tar.gz
bugzilla-170ec08234e29050c5d78d52e4100207625897d2.tar.xz
Bug 1456877 - Add a wrapper around libcmark_gfm to Bugzilla
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 7ab7031e7..9df38138d 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -38,6 +38,8 @@ use Bugzilla::Flag;
use Bugzilla::Hook;
use Bugzilla::Install::Localconfig qw(read_localconfig);
use Bugzilla::Install::Util qw(init_console include_languages);
+use Bugzilla::Markdown::GFM;
+use Bugzilla::Markdown::GFM::Parser;
use Bugzilla::Memcached;
use Bugzilla::Template;
use Bugzilla::Token;
@@ -865,6 +867,11 @@ sub check_rate_limit {
}
}
+sub markdown_parser {
+ return request_cache->{markdown_parser}
+ ||= Bugzilla::Markdown::GFM::Parser->new( {extensions => [qw( autolink tagfilter table strikethrough)] } );
+}
+
# Private methods
# Per-process cleanup. Note that this is a plain subroutine, not a method,
@@ -1190,6 +1197,11 @@ of features, see C<OPTIONAL_MODULES> in C<Bugzilla::Install::Requirements>.
Feeds the provided message into our centralised auditing system.
+=item C<markdown_parser>
+
+Returns a L<Bugzilla::Markdown::GFM::Parser> with the default extensions
+loaded (autolink, tagfilter, table, and strikethrough).
+
=back
=head1 B<CACHING>