Skip to content

Commit

Permalink
support newlines in event titles
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw committed Jul 3, 2010
1 parent c002cef commit c0c1445
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,12 @@ function smartProperty(obj, name) { // get a camel-cased/namespaced property of
}

function htmlEscape(s) {
return s
.replace(/&/g, '&')
return s.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/'/g, '&#039;')
.replace(/"/g, '&quot;');
.replace(/"/g, '&quot;')
.replace(/\n/g, '<br />');
}


Expand Down
5 changes: 5 additions & 0 deletions tests/sources.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
start: new Date(y, m, d-5),
end: new Date(y, m, d-2)
},
{
title: 'Event with \n newline',
start: new Date(y, m, d),
end: new Date(y, m, d)
},
{
title: 'T event',
start: y + '-06-06T10:20:00',
Expand Down

0 comments on commit c0c1445

Please sign in to comment.