Sha256: 38c990d1654717c5134dcd7c168f59a8f7267ef4fe78c56ac27fee072c175978
Contents?: true
Size: 374 Bytes
Versions: 1
Compression:
Stored size: 374 Bytes
Contents
function encodeHTMLSource() { var encodeHTMLRules = { "&": "&", "<": "<", ">": ">", '"': '"', "'": ''', "/": '/' }, matchHTML = /&(?!#?\w+;)|<|>|"|'|\//g; return function() { return this ? this.replace(matchHTML, function(m) {return encodeHTMLRules[m] || m;}) : this; }; } String.prototype.encodeHTML = encodeHTMLSource();
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sprockets-dotjs-2.0.3 | app/assets/javascripts/encode_html.js |