mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Increase abuse length to 3000
And correctly handle new lines
This commit is contained in:
parent
9a39392a7e
commit
1506307f2f
28 changed files with 136 additions and 80 deletions
|
@ -102,12 +102,18 @@ function objectToFormData (obj: any, form?: FormData, namespace?: string) {
|
|||
return fd
|
||||
}
|
||||
|
||||
function lineFeedToHtml (obj: any, keyToNormalize: string) {
|
||||
function objectLineFeedToHtml (obj: any, keyToNormalize: string) {
|
||||
return immutableAssign(obj, {
|
||||
[keyToNormalize]: obj[keyToNormalize].replace(/\r?\n|\r/g, '<br />')
|
||||
[keyToNormalize]: lineFeedToHtml(obj[keyToNormalize])
|
||||
})
|
||||
}
|
||||
|
||||
function lineFeedToHtml (text: string) {
|
||||
if (!text) return text
|
||||
|
||||
return text.replace(/\r?\n|\r/g, '<br />')
|
||||
}
|
||||
|
||||
function removeElementFromArray <T> (arr: T[], elem: T) {
|
||||
const index = arr.indexOf(elem)
|
||||
if (index !== -1) arr.splice(index, 1)
|
||||
|
@ -131,6 +137,7 @@ function scrollToTop () {
|
|||
export {
|
||||
sortBy,
|
||||
durationToString,
|
||||
lineFeedToHtml,
|
||||
objectToUrlEncoded,
|
||||
getParameterByName,
|
||||
populateAsyncUserVideoChannels,
|
||||
|
@ -138,7 +145,7 @@ export {
|
|||
dateToHuman,
|
||||
immutableAssign,
|
||||
objectToFormData,
|
||||
lineFeedToHtml,
|
||||
objectLineFeedToHtml,
|
||||
removeElementFromArray,
|
||||
scrollToTop
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue