sprockets-dotjs 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,8 @@
|
|
1
1
|
function encodeHTMLSource() {
|
2
|
-
var encodeHTMLRules = { "&": "&", "<": "<", ">": ">", '"': '"', "'": ''', "/": '/'
|
3
|
-
matchHTML = /&(?!#?\w+;)|<|>|"|'
|
2
|
+
var encodeHTMLRules = { "&": "&", "<": "<", ">": ">", '"': '"', "'": ''', "/": '/'},
|
3
|
+
matchHTML = /&(?!#?\w+;)|<|>|"|'|\//g;
|
4
4
|
return function() {
|
5
|
-
return this ? this.replace(matchHTML, function(m) {return encodeHTMLRules[m] || m;}) : this;
|
5
|
+
return this ? this.replace(matchHTML, function(m) {return encodeHTMLRules[m] || m; }).replace(/\n/,'<br>') : this;
|
6
6
|
};
|
7
7
|
}
|
8
8
|
String.prototype.encodeHTML = encodeHTMLSource();
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets-dotjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sprockets
|