no warnings 'utf8'; # this is needed because our perl is so old.
# This is a bit faster since it doesn't engage the regex engine.
# Replace < with \x{FDD4}, and remove \x{FDD4}.
- $markdown =~ tr/<\x{FDD4}/\x{FDD4}/d;
+ $markdown =~ tr/\x{FDD4}//d;
+ $markdown =~ s{<(?!https?://)}{\x{FDD4}}gs;
my @valid_text_parent_tags = ('p', 'li', 'td');
my @bad_tags = qw( img );
my $bugzilla_shorthand = $self->bugzilla_shorthand;
use Bugzilla::Test::MockDB;
use Bugzilla::Test::MockParams (password_complexity => 'no_constraints');
+use Mojo::DOM;
use Bugzilla;
use Test2::V0;
is($parser->render_html($table_markdown), $table_html, 'Table extension');
+{
+ no warnings 'utf8';
+ is($parser->render_html("\x{FDD4}"), "", "strips out PUA char");
+}
+
+my $angle_link = $parser->render_html("<https://searchfox.org/mozilla-central/rev/76fe4bb385348d3f45bbebcf69ba8c7283dfcec7/mobile/android/base/java/org/mozilla/gecko/toolbar/SecurityModeUtil.java#101>");
+
+my $angle_link_dom = Mojo::DOM->new($angle_link);
+my $ahref = $angle_link_dom->at('a[href]');
+is($ahref->attr('href'), 'https://searchfox.org/mozilla-central/rev/76fe4bb385348d3f45bbebcf69ba8c7283dfcec7/mobile/android/base/java/org/mozilla/gecko/toolbar/SecurityModeUtil.java#101', 'angle links are parsed properly');
+
+is($parser->render_html('<foo>'), "<p><foo></p>\n", "literal tags work");
+
done_testing;