chore: clean up lint and scratchpad

This commit is contained in:
Peter Steinberger
2026-01-07 01:28:46 +00:00
parent bc9a3ce32a
commit b88c4e9d20
4 changed files with 24 additions and 26 deletions

View File

@@ -94,7 +94,12 @@ function parseSearchOutput(raw: string): DocResult[] {
const content = extractLine(lines, "Content:");
const contentIndex = lines.findIndex((line) => line.startsWith("Content:"));
const body =
contentIndex >= 0 ? lines.slice(contentIndex + 1).join("\n").trim() : "";
contentIndex >= 0
? lines
.slice(contentIndex + 1)
.join("\n")
.trim()
: "";
const snippet = normalizeSnippet(content, firstParagraph(body));
results.push({ title, link, snippet: snippet || undefined });
}
@@ -102,7 +107,7 @@ function parseSearchOutput(raw: string): DocResult[] {
}
function escapeMarkdown(text: string): string {
return text.replace(/[\[\]()]/g, "\\$&");
return text.replace(/[()[\]]/g, "\\$&");
}
function buildMarkdown(query: string, results: DocResult[]): string {