Skip to content

Preserve DOCX manual line breaks - #186

Open
dipeshbabu wants to merge 1 commit into
openai:mainfrom
dipeshbabu:agent/preserve-docx-line-breaks
Open

Preserve DOCX manual line breaks#186
dipeshbabu wants to merge 1 commit into
openai:mainfrom
dipeshbabu:agent/preserve-docx-line-breaks

Conversation

@dipeshbabu

Copy link
Copy Markdown
Contributor

Summary

  • preserve DOCX manual line breaks while extracting knowledge-base text
  • extend the existing DOCX fixture with adjacent text separated by <w:br/>

Root cause

The DOCX extractor handled paragraph endings and tabs before stripping XML tags, but it did not handle WordprocessingML break elements. The generic tag removal therefore deleted <w:br/> without inserting whitespace and concatenated text from either side.

Impact

Prepared DOCX knowledge bases retain word boundaries and line structure around manual breaks, improving the text supplied to scans.

Overlap check

Searched open issues and pull requests for DOCX line breaks, manual knowledge-base breaks, and w:br; no overlapping work was found.

Validation

  • pnpm dlx bun test --timeout 30000 ./tests-ts/knowledge-base.test.ts (5 passed, 2 platform skips)
  • pnpm exec tsc --noEmit
  • pnpm exec prettier --check src/knowledge-base.ts tests-ts/knowledge-base.test.ts
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant