Skip to content

Commit

Permalink
feat: add tests for current empty lines processor
Browse files Browse the repository at this point in the history
  • Loading branch information
robertu7 committed Mar 11, 2024
1 parent a32f702 commit 64881c5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/transformers/sanitize.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { stripIndent } from 'common-tags'
import { describe, expect, test } from 'vitest'

import { sanitizeHTML } from './sanitize'
Expand All @@ -18,6 +19,25 @@ describe('Sanitization: custom', () => {
'<a class="">pp</a>',
)
})

test('allow max two empty paragraphys', () => {
expectSanitizeHTML(
'<p>abc</p><p></p><p></p><p></p><p>abc</p><p></p><p></p><p></p><p></p><p></p><p></p>',
stripIndent`
<p>abc</p>
<p></p>
<p></p>
<p></p>
<p>abc</p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
`,
)
})
})

// via https://github.com/leizongmin/js-xss/blob/master/test/test_xss.js
Expand Down

0 comments on commit 64881c5

Please sign in to comment.