Skip to content

Commit d251915

Browse files
committed
fix(sandbox): clarify pptx null-guard message; fix bold=false inheritance sentinel in docx style extractor
1 parent 19bceae commit d251915

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

apps/sim/lib/copilot/vfs/document-style.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,9 @@ function parseDocxStyles(
182182
type,
183183
...(basedOnMatch && { basedOn: basedOnMatch[1] }),
184184
...(szMatch && { fontSize: Math.round(Number.parseInt(szMatch[1]) / 2) }),
185-
...(/<w:b\b(?:\s[^/]*)?\/?>/.test(block) &&
186-
!/<w:b\b[^>]*\bw:val=["'](0|false)["']/.test(block) && { bold: true }),
185+
...(/<w:b\b(?:\s[^/]*)?\/?>/.test(block) && {
186+
bold: !/<w:b\b[^>]*\bw:val=["'](0|false)["']/.test(block),
187+
}),
187188
...(colorMatch && { color: colorMatch[1].toUpperCase() }),
188189
...(font && { font }),
189190
...(themeFont && { themeFont }),
@@ -236,7 +237,7 @@ function parseDocxStyles(
236237
name: resolved.name,
237238
type: resolved.type,
238239
...(resolved.fontSize !== undefined && { fontSize: resolved.fontSize }),
239-
...(resolved.bold && { bold: resolved.bold }),
240+
...(resolved.bold !== undefined && { bold: resolved.bold }),
240241
...(resolved.color && { color: resolved.color }),
241242
...(resolvedFont && { font: resolvedFont }),
242243
})

apps/sim/sandbox-tasks/pptx-generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const pptxGenerateTask = defineSandboxTask<SandboxTaskInput>({
6161
`,
6262
finalize: `
6363
if (!globalThis.pptx) {
64-
throw new Error('No presentation found. Do not overwrite globalThis.pptx call globalThis.pptx.addSlide() directly.');
64+
throw new Error('No presentation found. globalThis.pptx was overwritten — use the pre-initialized instance and call addSlide() on it to build your presentation.');
6565
}
6666
const bytes = await globalThis.pptx.write({ outputType: 'uint8array' });
6767
return bytes;

0 commit comments

Comments
 (0)