fix(route): [Coolapk] Wrong html tag wrapping (#7601)
This commit is contained in:
parent
832e3ff8d1
commit
82749371ec
|
|
@ -38,7 +38,12 @@ const getHeaders = () => ({
|
|||
const parseTuwenFromRaw = (raw) =>
|
||||
raw.map((i) => {
|
||||
if (i.type === 'text') {
|
||||
return `<p>${i.message}</p>`;
|
||||
const output = i.message
|
||||
.split('\n')
|
||||
.filter((t) => t !== '')
|
||||
.map((t) => `<p>${t}</p>`)
|
||||
.join('');
|
||||
return output;
|
||||
} else if (i.type === 'image') {
|
||||
return `<div class="img-container" style="text-align: center;">
|
||||
<img src="${i.url}">
|
||||
|
|
|
|||
Loading…
Reference in New Issue