kiki/coffee/tools/encode.coffee
2016-10-10 18:28:35 +02:00

14 lines
486 B
CoffeeScript

# 00000000 000 000 0000000 0000000 0000000 00000000
# 000 0000 000 000 000 000 000 000 000
# 0000000 000 0 000 000 000 000 000 000 0000000
# 000 000 0000 000 000 000 000 000 000
# 00000000 000 000 0000000 0000000 0000000 00000000
encode = require('html-entities').XmlEntities.encode
module.exports = (s) ->
if s
r = encode s
r = r.replace /\s/g, ' '
else
''