# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. use 5.10.1; use strict; use warnings; use lib qw( . lib local/lib/perl5 ); use Bugzilla; use Test2::V0; my $parser = Bugzilla->markdown_parser; is($parser->render_html('# header'), "

header

\n", 'Simple header'); is( $parser->render_html('`code snippet`'), "

code snippet

\n", 'Simple code snippet' ); is( $parser->render_html('http://bmo-web.vm'), "

http://bmo-web.vm

\n", 'Autolink extension' ); is( $parser->render_html(''), "<script>hijack()</script>\n", 'Tagfilter extension' ); is( $parser->render_html('~~strikethrough~~'), "

strikethrough

\n", 'Strikethrough extension' ); my $table_markdown = <<'MARKDOWN'; | Col1 | Col2 | | ---- |:----:| | val1 | val2 | MARKDOWN my $table_html = <<'HTML';
Col1 Col2
val1 val2
HTML is($parser->render_html($table_markdown), $table_html, 'Table extension'); done_testing;