dox/utils.coffee

##
# Escape the given `html`.
#
# @param {String} html
# @return {String}
# @api private
exports.escape = (html) ->
  return String(html)
  .replace /&(?!\w+;)/g, '&'
  .replace /</g, '&lt;'
  .replace />/g, '&gt;'
Fork me on GitHub