mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
group comments (bad way)
This commit is contained in:
parent
6bf14e6d5c
commit
39b0a2d568
6 changed files with 35 additions and 16 deletions
|
@ -71,5 +71,7 @@ export const formatCommentText = (author, text: string) =>
|
|||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.split('\n')
|
||||
.map((el, index) => (index === 0 ? `<p><b>${author}</b>: ${el}</p>` : `<p>${el}</p>`))
|
||||
.map((el, index) =>
|
||||
index === 0 ? `${author ? `<p><b>${author}</b>: ` : ''}${el}</p>` : `<p>${el}</p>`
|
||||
)
|
||||
.join('');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue