fix(route): [Coolapk] Wrong html tag wrapping (#7601)

This commit is contained in:
techmoe
2021-05-30 09:04:18 -07:00
committed by GitHub
parent 832e3ff8d1
commit 82749371ec
+6 -1
View File
@@ -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}">