Skip to content

Commit 591874c

Browse files
committed
fix(connectors): jira pagination signal and google-docs paragraph join
- jira: rely solely on absence of nextPageToken for end-of-results; data.isLast on /rest/api/3/search/jql is unreliable (JRACLOUD-95477) and the OR-with-isLast logic could truncate pagination early - google-docs: strip trailing newline from each paragraph before joining so heading->body produces a single newline, not two
1 parent f4790e0 commit 591874c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

apps/sim/connectors/google-docs/google-docs.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,15 @@ function extractTextFromDocsBody(doc: DocsDocument): string {
8484
if (!paragraph?.elements) continue
8585

8686
const prefix = headingPrefix(paragraph.paragraphStyle?.namedStyleType)
87-
const text = paragraph.elements.map((el) => el.textRun?.content ?? '').join('')
87+
/**
88+
* Each paragraph's final `textRun.content` already ends with `\n`. Strip
89+
* it before joining with `\n` so a heading followed by a body paragraph
90+
* is separated by a single newline, not two.
91+
*/
92+
const text = paragraph.elements
93+
.map((el) => el.textRun?.content ?? '')
94+
.join('')
95+
.replace(/\n+$/, '')
8896

8997
if (text.trim()) {
9098
parts.push(`${prefix}${text}`)

0 commit comments

Comments
 (0)