mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
fix: strip_html for multi line <script>/<style>/comments, #70
This commit is contained in:
@@ -390,4 +390,14 @@ describe('Issues', function () {
|
||||
const html = await liquid.parseAndRender(tpl, ctx)
|
||||
expect(html.trim()).to.equal('<a href="https://example.com">Lot more code here</a>')
|
||||
})
|
||||
it('#70 strip multiline content of <style>', async() => {
|
||||
const str = `
|
||||
<style type="text/css">
|
||||
.test-one-line {display: none;}
|
||||
</style>`
|
||||
const engine = new Liquid()
|
||||
const template = '{{ str | strip_html }}'
|
||||
const html = await engine.parseAndRender(template, { str })
|
||||
expect(html).to.match(/^\s*$/)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user