Skip to content

Commit 7f0062b

Browse files
authored
Bug 2052749: The t/markdown.t test can fail if an extension modifies tag contents (#166)
r=mrenvoize
1 parent 23308c2 commit 7f0062b

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

t/markdown.t

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ my $angle_link_dom = Mojo::DOM->new($angle_link);
8484
my $ahref = $angle_link_dom->at('a[href]');
8585
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');
8686

87-
is($parser->render_html('<foo>'), "<p>&lt;foo&gt;</p>\n", "literal tags work");
87+
# Test that literal tags are not parsed as HTML, but are instead escaped.
88+
# Need to use a tag that is not likely to get used in a real use case,
89+
# because the bug_format_comment extension hook is allowed to arbitrarily
90+
# modify the comment text, and we don't want to accidentally break a real
91+
# use case where the tag contents might get modified and break our test.
92+
is(
93+
$parser->render_html('<markdownliteraltesttoken>'),
94+
"<p>&lt;markdownliteraltesttoken&gt;</p>\n",
95+
'literal tags work'
96+
);
8897

8998
done_testing;

0 commit comments

Comments
 (0)