Skip to content

Commit

Permalink
add test for base html escapes being used with additional escapes
Browse files Browse the repository at this point in the history
  • Loading branch information
patricksimonian committed Dec 19, 2019
1 parent 0cede80 commit 8883269
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/gatsby-remark-prismjs/src/__tests__/escape-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,14 @@ describe(`escaping html entities`, () => {
}
expect(escapeHtml(code, mapping)).toBe(`hello world{`)
})

it(`escapes base html entities and additional html entities`, () => {
const code = `hello world&><"'{`
const mapping = {
"{": `&#123;`,
}
expect(escapeHtml(code, mapping)).toBe(
`hello world&amp;&gt;&lt;&quot;&#39;&#123;`
)
})
})

0 comments on commit 8883269

Please sign in to comment.