(post: PostMarkdownPost)
| 317 | * post anonymously. |
| 318 | */ |
| 319 | const buildAnsweredQuestions = (post: PostMarkdownPost): string[] => { |
| 320 | const questions = post.answeredQuestions; |
| 321 | |
| 322 | if (!questions?.length) { |
| 323 | return []; |
| 324 | } |
| 325 | |
| 326 | const lines = ['## Questions this post answers', '']; |
| 327 | |
| 328 | questions.forEach(({ question, answer, cta }) => { |
| 329 | lines.push(`### ${question}`); |
| 330 | lines.push(''); |
| 331 | lines.push(answer); |
| 332 | |
| 333 | if (cta?.trim()) { |
| 334 | lines.push(''); |
| 335 | lines.push(`_${cta.trim()}_`); |
| 336 | } |
| 337 | |
| 338 | lines.push(''); |
| 339 | }); |
| 340 | |
| 341 | return lines; |
| 342 | }; |
| 343 | |
| 344 | const buildCommunityTake = (post: PostMarkdownPost): string[] => { |
| 345 | const take = post.communitySentiment; |
no test coverage detected