* Assembles the document content from a note's title and summary. Prefers the * markdown summary, falling back to plain-text summary. HTML is stripped only * when detected so markdown formatting is preserved.
(note: GranolaNoteDetail)
| 153 | * when detected so markdown formatting is preserved. |
| 154 | */ |
| 155 | function buildContent(note: GranolaNoteDetail): string { |
| 156 | const parts: string[] = [] |
| 157 | |
| 158 | const title = note.title?.trim() |
| 159 | if (title) parts.push(`# ${title}`) |
| 160 | |
| 161 | const rawSummary = note.summary_markdown?.trim() || note.summary_text?.trim() || '' |
| 162 | if (rawSummary) { |
| 163 | parts.push('') |
| 164 | parts.push(looksLikeHtml(rawSummary) ? htmlToPlainText(rawSummary) : rawSummary) |
| 165 | } |
| 166 | |
| 167 | return parts.join('\n').trim() |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * Resolves an owner's display name, falling back to email, for tag mapping. |
no test coverage detected