1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Handle line feeds in comments

This commit is contained in:
Chocobozzz 2018-02-20 10:41:11 +01:00
parent 2f315e2f91
commit 5de8a55abc
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 16 additions and 6 deletions

View file

@ -88,6 +88,12 @@ function objectToFormData (obj: any, form?: FormData, namespace?: string) {
return fd
}
function lineFeedToHtml (obj: object, keyToNormalize: string) {
return immutableAssign(obj, {
[keyToNormalize]: obj[keyToNormalize].replace(/\r?\n|\r/g, '<br />')
})
}
export {
viewportHeight,
getParameterByName,
@ -97,5 +103,6 @@ export {
isInSmallView,
isInMobileView,
immutableAssign,
objectToFormData
objectToFormData,
lineFeedToHtml
}