Skip to content

Commit 499fc01

Browse files
fix: skip HTML comments in entity escaping test
HTML comments like <!-- prettier-ignore-start --> are intentional markdown and should not be flagged by the entity escaping test.
1 parent 3105ef9 commit 499fc01

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

test/unit/markdown.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,15 @@ describe('markdown output: plugin-auth and user', () => {
111111
// If there are any < or > characters in descriptions, they should be escaped
112112
const lines = md.split('\n');
113113
for (const line of lines) {
114-
// Skip code blocks and HTML tags we intentionally create
115-
if (line.includes('```') || line.startsWith('<ul>') || line.startsWith('<li>') || line.startsWith(':::')) {
114+
// Skip code blocks, HTML tags/comments we intentionally create, and markdown directives
115+
if (
116+
line.includes('```') ||
117+
line.startsWith('<ul>') ||
118+
line.startsWith('<li>') ||
119+
line.startsWith(':::') ||
120+
line.includes('<!--') ||
121+
line.includes('<br>')
122+
) {
116123
continue;
117124
}
118125
// Check that raw < and > are not present (they should be &lt; and &gt;)

0 commit comments

Comments
 (0)