fix: escape markdown characters in web search result titles and descriptions - #1282
awhite0030 wants to merge 3 commits into
Conversation
nc-review: needs work — 1 blocking, 2 important, 1 nit@awhite0030 — there is a blocking item below. The fix itself is correct: the new 🔴 blocking · The PR rewrites So clicking the badge in the rendered README would navigate to the contributor's fork, not the project. This is unrelated to the markdown-escape fix. Drop the badge rewrite (revert all 🟠 important · Five other files in 🟠 important · The PR claims to include ⚪ nit ·
🔴 blocking · 🟠 a reviewer would ask for a change · ⚪ optional Automated code review — correctness, security, design, tests, plus duplicates and scope. A human still decides; this is not a substitute for review and is not exhaustive. The required status checks separately cover lint, formatting, types, unused dependencies, the test suite and the build. This bot never merges. Maintainers can rerun with |
|
Can you take a look at the bot comments and merge conflicts please @awhite0030 :) |
Description
Brief description of what this PR does
Type of Change
Changeset
pnpm changeset) describing this change for the changelogDocs-only or internal chores need no changeset (or run
pnpm changeset --emptyto note that intentionally).Testing
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)Manual Testing
Checklist
Root cause: Search result titles and descriptions from the Brave Search API may contain characters that could be misinterpreted as Markdown syntax (e.g.,
*,_,[,],<), leading to corrupted layout formatting or unintended link spoofing when compiled into the final markdown output.Fix: Created an
escapeMarkdownutility function that escapes common markdown characters. Applied this function to format thetitleanddescriptionof each Brave Search API result inweb-search.tsx. Added comprehensive test coverage for the escaping logic. Included a valid changeset.Validation:
corepack enable pnpm install --frozen-lockfile pnpm run build pnpm test:format pnpm test:lint pnpm test:types pnpm test:knip pnpm test:avaFixes #1146
Fixes #1146