Files
atom/src/stdlib/template/text.coffee
Danny Greg & Nathan Sobo 5e41f82985 Add a raw call to builder.
2012-01-19 16:46:32 -08:00

16 lines
291 B
CoffeeScript

module.exports =
class Text
constructor: (@string, @raw=false) ->
toHtml: ->
if @raw
@string
else
@string
.replace(/&/g, '&')
.replace(/"/g, '"')
.replace(/'/g, ''')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')