Skip to content

Commit b08332c

Browse files
homeofeCopilot
andcommitted
fix(test): handle UTF-8 BOM in README intro extraction
- sanitize leading BOM before parsing README title/intro\n- stabilizes prompt-builder README intro test on GitHub Actions Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9d7f8ac commit b08332c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/context-reader.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import { readFileSync } from 'fs';
1010
* paragraph (text block between blank lines).
1111
*/
1212
export function extractReadmeIntro(content: string): string {
13-
const lines = content.split('\n');
13+
const sanitized = content.replace(/^\uFEFF/, '');
14+
const lines = sanitized.split('\n');
1415
const paragraph: string[] = [];
1516
let pastTitle = false;
1617

0 commit comments

Comments
 (0)