MCPcopy Index your code
hub / github.com/simstudioai/sim / buildContent

Function buildContent

apps/sim/connectors/granola/granola.ts:155–168  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

153 * when detected so markdown formatting is preserved.
154 */
155function 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.

Callers 1

granola.tsFile · 0.70

Calls 4

htmlToPlainTextFunction · 0.90
looksLikeHtmlFunction · 0.85
joinMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected