fix(seo): escape backslashes in llms-full.txt comparison table cells - #8529
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
| const value = fact ? (fact.shortValue ?? fact.value) : 'Unknown' | ||
| return value.replace(/\|/g, '\\|').replace(/\s*\n\s*/g, ' ') | ||
| return value | ||
| .replace(/\\/g, '\\\\') |
There was a problem hiding this comment.
Escaping Fix Lacks Test The new backslash-escaping case has no regression test, and the current comparison facts do not exercise it. A test with a literal backslash immediately before a pipe should check that the output remains a three-column Markdown row; without one, a later change to the escape order could silently bring back the table break this PR fixes.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
factCellso a fact value containing\can't turn an escaped\|back into a column break in the/llms-full.txtcomparison tablesjs/incomplete-sanitizationalert onapps/sim/app/llms-full.txt/route.tsType of Change
Testing
bun run lint,bun run check:audits(53 audits),docs-manifest:check,type-checkall pass; spot-checked the escaping in node (a\|b | c→a\\\|b \| c)Checklist
test-auditauthoring gate)