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