Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
lib-ical
Commits
f0c2e8b1
Commit
f0c2e8b1
authored
Dec 08, 2015
by
Andi Sidwell
Browse files
Normalise linebreaks before escaping them
parent
2d46a933
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/_tools.js
View file @
f0c2e8b1
...
...
@@ -28,13 +28,9 @@ module.exports.formatDate = function formatDate(d, dateonly, floating) {
};
module
.
exports
.
escape
=
function
escape
(
str
)
{
return
str
.
replace
(
/
[\\
;,
\n
"
]
/g
,
function
(
match
)
{
if
(
match
===
'
\n
'
)
{
return
'
\\
n
'
;
}
return
str
.
replace
(
/
[\\
;,"
]
/g
,
function
(
match
)
{
return
'
\\
'
+
match
;
});
})
.
replace
(
/
(?:\r\n
|
\r
|
\n)
/g
,
'
\\
n
'
)
;
};
module
.
exports
.
duration
=
function
duration
(
seconds
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment