From 170ec08234e29050c5d78d52e4100207625897d2 Mon Sep 17 00:00:00 2001 From: Israel Madueme Date: Fri, 15 Jun 2018 14:42:19 -0700 Subject: Bug 1456877 - Add a wrapper around libcmark_gfm to Bugzilla --- Bugzilla.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Bugzilla.pm') 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 in C. Feeds the provided message into our centralised auditing system. +=item C + +Returns a L with the default extensions +loaded (autolink, tagfilter, table, and strikethrough). + =back =head1 B -- cgit v1.2.3-24-g4f1b