Skip to content

sdk: make FTS snippet highlighting unambiguous for literal HTML #516

Description

@willwashburn

Context

Follow-up from #406. The SDK search verb returns snippets whose FTS5 match
boundaries use literal <b> / </b> markers. When stored content itself
contains those tags, presenters cannot distinguish match markup from
user-authored content: stripping or translating every tag can silently alter
content or falsely highlight an unmatched phrase.

Scope

  • Preserve a stable, machine-readable search result contract.
  • Represent match boundaries unambiguously even when content includes literal
    HTML-like tags.
  • Update Rust SDK tests and downstream presenters to prove literal <b>
    content is preserved and only actual matches are highlighted.

Acceptance

  • A content record containing literal <b>already tagged</b> round-trips
    without deletion or false match highlighting.
  • JSON and human presenters have documented, deterministic match-boundary
    behavior.
  • Existing phrase, boolean, prefix, and session-scoped FTS searches remain
    unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions