Skip to content

Commit b3cd02a

Browse files
authored
Merge pull request #343 from holly-weisser/296_new_line
Issue 296
2 parents c39b4dd + 92040af commit b3cd02a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/utils/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ var utils = module.exports = {
7979
},
8080
xmlEncode: function(text) {
8181
// eslint-disable-next-line no-control-regex
82-
return text.replace(/[<>&'"\x7F\x00-\x08\x0A-\x0C\x0E-\x1F]/g, function(c) {
82+
return text.replace(/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/g, function(c) {
8383
switch (c) {
8484
case '<': return '&lt;';
8585
case '>': return '&gt;';

spec/unit/utils/utils.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ describe('utils', function() {
1717
.to.equal('abc abc');
1818

1919
expect(utils.xmlEncode('<a href="www.whatever.com">Talk to the H&</a>')).to.equal('&lt;a href=&quot;www.whatever.com&quot;&gt;Talk to the H&amp;&lt;/a&gt;');
20+
21+
expect(utils.xmlEncode('new\x0aline')).to.equal('new\x0aline');
2022
});
2123
});
2224
describe('isDateFmt', function() {

0 commit comments

Comments
 (0)