]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/helpers/utils/html.ts
Merge branch 'release/4.1.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / helpers / utils / html.ts
CommitLineData
dd24f1bb
C
1import { immutableAssign } from './object'
2
3function objectLineFeedToHtml (obj: any, keyToNormalize: string) {
4 return immutableAssign(obj, {
5 [keyToNormalize]: lineFeedToHtml(obj[keyToNormalize])
6 })
7}
8
9function lineFeedToHtml (text: string) {
10 if (!text) return text
11
12 return text.replace(/\r?\n|\r/g, '<br />')
13}
14
15export {
16 objectLineFeedToHtml,
17 lineFeedToHtml
18}