Skip to content

Commit

Permalink
🐛 fix(generator): \r\n are now replaced with spaces instead of being …
Browse files Browse the repository at this point in the history
…removed
  • Loading branch information
ligen131 committed Apr 1, 2023
1 parent 71913f0 commit 87001df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/generator.js
Expand Up @@ -11,7 +11,9 @@ env.addFilter('uriencode', str => {
});

env.addFilter('noControlChars', str => {
return str.replace(/[\x00-\x1F\x7F]/g, ''); // eslint-disable-line no-control-regex
// eslint-disable-line no-control-regex
str = str.replace(/[\x0A\x0D]/g, ' ');
return str.replace(/[\x00-\x1F\x7F]/g, '');
});

module.exports = function(locals, type, path) {
Expand Down
4 changes: 3 additions & 1 deletion test/index.js
Expand Up @@ -15,7 +15,9 @@ env.addFilter('uriencode', str => {
});

env.addFilter('noControlChars', str => {
return str.replace(/[\x00-\x1F\x7F]/g, ''); // eslint-disable-line no-control-regex
// eslint-disable-line no-control-regex
str = str.replace(/[\x0A\x0D]/g, ' ');
return str.replace(/[\x00-\x1F\x7F]/g, '');
});

const atomTmplSrc = join(__dirname, '../atom.xml');
Expand Down

0 comments on commit 87001df

Please sign in to comment.