Skip to content

Commit 8883269

Browse files
add test for base html escapes being used with additional escapes
1 parent 0cede80 commit 8883269

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/gatsby-remark-prismjs/src/__tests__/escape-html.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,14 @@ describe(`escaping html entities`, () => {
1313
}
1414
expect(escapeHtml(code, mapping)).toBe(`hello world{`)
1515
})
16+
17+
it(`escapes base html entities and additional html entities`, () => {
18+
const code = `hello world&><"'{`
19+
const mapping = {
20+
"{": `&#123;`,
21+
}
22+
expect(escapeHtml(code, mapping)).toBe(
23+
`hello world&amp;&gt;&lt;&quot;&#39;&#123;`
24+
)
25+
})
1626
})

0 commit comments

Comments
 (0)