app/assets/javascripts/encode_html.js in sprockets-dotjs-2.0.3 vs app/assets/javascripts/encode_html.js in sprockets-dotjs-2.1.0

- old
+ new

@@ -1,7 +1,7 @@ function encodeHTMLSource() { - var encodeHTMLRules = { "&": "&#38;", "<": "&#60;", ">": "&#62;", '"': '&#34;', "'": '&#39;', "/": '&#47;' }, - matchHTML = /&(?!#?\w+;)|<|>|"|'|\//g; + var encodeHTMLRules = { "&": "&#38;", "<": "&#60;", ">": "&#62;", '"': '&#34;', "'": '&#39;', "/": '&#47;', "\n": '<br>' }, + matchHTML = /&(?!#?\w+;)|<|>|"|'|\/\n/g; return function() { return this ? this.replace(matchHTML, function(m) {return encodeHTMLRules[m] || m;}) : this; }; } String.prototype.encodeHTML = encodeHTMLSource(); \ No newline at end of file