Skip to content

Commit

Permalink
Add test of html option with header and footer
Browse files Browse the repository at this point in the history
It has reported in yhatt/marp#243. These elements have over-sanitized
regular markdown syntaxes.
  • Loading branch information
yhatt committed Sep 5, 2018
1 parent 2ce194e commit 5f7dfe5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/marp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ describe('Marp', () => {
const { html } = marp().render('allow<br>break')
expect(cheerio.load(html)('br')).toHaveLength(1)
})

it('does not sanitize header and footer', () => {
const markdown = '<!--\nheader: "**header**"\nfooter: "*footer*"\n-->'
const $ = cheerio.load(marp().render(markdown).html)

expect($('header > strong')).toHaveLength(1)
expect($('footer > em')).toHaveLength(1)
})
})

context('with true', () => {
Expand Down

0 comments on commit 5f7dfe5

Please sign in to comment.