Skip to content

Fix/search code block indexing#1194

Merged
perber merged 2 commits into
mainfrom
fix/search-code-block-indexing
Jun 22, 2026
Merged

Fix/search code block indexing#1194
perber merged 2 commits into
mainfrom
fix/search-code-block-indexing

Conversation

@perber

@perber perber commented Jun 22, 2026

Copy link
Copy Markdown
Owner

No description provided.

perber added 2 commits June 22, 2026 22:17
…k-quotes

Fixes #1190. Search could not find terms like "curl" or "Fetch" that only
appeared inside fenced code blocks.

- Split PlainTextFromMarkdown into PlainTextForSearch (preserves code content
  for FTS indexing) and PlainTextFromMarkdown (strips code for display excerpts)
- Inline patterns (wikiLink, wikiImage etc.) now skip lines inside fenced code
  blocks so code content is preserved verbatim in the search index
- fencePattern required "^ {0,3}" (literal spaces), so "> ```go" block-quote
  prefixes were invisible to fence detection — fixed by stripping block-quote
  markers before the fence check
- Fence-opening line was incorrectly processed by patterns (fence==nil at
  if-check time) — fixed by guarding with fence==nil && nextFence==nil
Mermaid blocks contain structural syntax tokens (graph TD, -->, classDef,
style) that are not meaningful search terms and would pollute results.
Strip them in PlainTextForSearch while keeping other code block content.
Copilot AI review requested due to automatic review settings June 22, 2026 20:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@perber perber merged commit 494ce07 into main Jun 22, 2026
9 checks passed
@perber perber deleted the fix/search-code-block-indexing branch June 22, 2026 21:14
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.

2 participants