Skip to content

Commit

Permalink
fix(route): [Coolapk] Wrong html tag wrapping (DIYgod#7601)
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-techmoe authored May 30, 2021
1 parent 832e3ff commit 8274937
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/routes/coolapk/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}">
Expand Down

0 comments on commit 8274937

Please sign in to comment.