From 62270e7477165d17ee8c90b5a95ad9b29d787121 Mon Sep 17 00:00:00 2001 From: Dave Miller Date: Sun, 5 Jul 2026 01:27:19 -0400 Subject: [PATCH] Bug 2052749: The t/markdown.t test can fail if an extension modifies tag contents --- t/markdown.t | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/t/markdown.t b/t/markdown.t index 1cd9ff0ec6..dd980b84a0 100644 --- a/t/markdown.t +++ b/t/markdown.t @@ -84,6 +84,15 @@ 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>

\n", "literal tags work"); +# Test that literal tags are not parsed as HTML, but are instead escaped. +# Need to use a tag that is not likely to get used in a real use case, +# because the bug_format_comment extension hook is allowed to arbitrarily +# modify the comment text, and we don't want to accidentally break a real +# use case where the tag contents might get modified and break our test. +is( + $parser->render_html(''), + "

<markdownliteraltesttoken>

\n", + 'literal tags work' +); done_testing;