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:
parent
2f315e2f91
commit
5de8a55abc
4 changed files with 16 additions and 6 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue