coffeecup
Version:
Markup as CoffeeScript.
15 lines (11 loc) • 858 B
text/coffeescript
cc = require '../lib/coffeecup'
describe 'Escaping', ->
describe "h1 h(\"<script>alert('\"owned\" by c&a ©')</script>)", ->
it "should render <h1><script>alert('"owned" by c&a &copy;')</script></h1>", ->
t = -> h1 h("<script>alert('\"owned\" by c&a ©')</script>")
cc.render(t).should.equal "<h1><script>alert('"owned" by c&a &copy;')</script></h1>"
describe 'AutoEscaping', ->
describe "h1 <script>alert('\"owned\" by c&a ©')</script>", ->
it "should render <h1><script>alert('"owned" by c&a &copy;')</script></h1>", ->
t = -> h1 "<script>alert('\"owned\" by c&a ©')</script>"
cc.render(t, autoescape: yes).should.equal "<h1><script>alert('"owned" by c&a &copy;')</script></h1>"