Skip to content

docs: add recipes for accent-insensitive filtering and <mark> highlights - #899

Merged
tkirda merged 1 commit into
masterfrom
docs/formatting-recipes
Sep 29, 2026
Merged

tkirda merged 1 commit into
masterfrom
docs/formatting-recipes

Conversation

@tkirda

@tkirda tkirda commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Closes #893. Replaces #898, which added an ignoreDiacritics option; that option plus the callback signature change was more API surface than one request justified.

README additions:

  • Local-only settings: a custom lookupFilter that folds diacritics (NFD + strip \p{M} + lowercase), so cafe finds Café. Notes that the default formatResult won't highlight accent-folded matches.
  • Styling: wrapping $.Autocomplete.defaults.formatResult to swap <strong> for <mark>. Safe because the default formatter escapes everything except its own <strong> tags.

Both snippets were checked against the built plugin in a throwaway Vitest spec (accented, decomposed and HTML-bearing values).

🤖 Generated with Claude Code

Refs #893. Covers both requests without new options: a custom lookupFilter that folds diacritics, and a wrapper around the default formatResult that swaps <strong> for <mark>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tkirda
tkirda merged commit 3150c22 into master Sep 29, 2026
3 checks passed
@tkirda
tkirda deleted the docs/formatting-recipes branch September 29, 2026 13:28
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.

Allow more customizations of formatResult()

2 participants