Previously, scrollToSearchTerm always scrolled to the first DOM occurrence
of the search term. Now it checks headings first, then body text, so
navigating from a search result that matched a heading correctly scrolls
to that heading instead of an earlier body occurrence.
Title and content use innerHTML with a whitelist that only allows <span>
tags (used by the highlight function). All other HTML is stripped.
Tags use pre-escaped content from highlightTags with trusted structural markup.
Subscribe to the content-index-updated CustomEvent and incrementally add
newly-patched entries to the FlexSearch index. The existing indexInitialized
memoization is preserved -- no full rebuild, just additive inserts via
index.addAsync(), plus updates to idDataMap, contentData, and allTags.
This enables runtime extension of the search index by other plugins. The
primary consumer is @quartz-community/encrypted-pages, which patches the
resolved fetchData object with decrypted entries from its shadow content
index and dispatches content-index-updated so users can find and open
decrypted pages via search within the same browser session.
Non-fatal: the listener swallows errors from the in-place fetchData read
and continues with whatever content-index data was loaded originally.
- Set sidebar z-index to auto when search opens to break stacking context
that trapped the fixed search modal behind page content
- Rewrite scroll-to-search-term to search textContent of block-level
elements and walk text nodes to build cross-element Range, handling
terms that span multiple inline elements
Store search term in sessionStorage when clicking a result, then on
page load find the first matching text, highlight it with a fade-out
animation, and scroll it into view.
- Fix highlight() trim bug: slice tokenized text array, correct window math
- Fix memory leak: use event delegation instead of per-element listeners
- Fix XSS: escape content with escapeHTML before innerHTML insertion
- Add multi-tag search (#tag1 #tag2 query) with AND filtering
- Add tag autocomplete dropdown with keyboard navigation
- Add inline ghost text for selected tag suggestion
- Add configurable result ordering via fieldPriority option
- Add scroll-to-highlight in preview panel
- Add ARIA attributes (listbox, option, aria-expanded, aria-label)
- Add error handling in fetchContent (try/catch, !res.ok check)
- Add 150ms debounce on preview updates
- Add index initialization guard for tag dropdown
- Use parallel index filling (Promise.all)
- Remove debug console.log statements
- Restore button refocus after hiding search
- Use CSS custom property for z-index management
- Add max-height constraint for mobile results
- Update all 6 locales with ellipsis placeholder and tag search strings
- Export SearchField type
Use resolveBasePath() from @quartz-community/utils/path to prepend the
base path when navigating via search results. Fixes links resolving to
the domain root instead of the subdirectory.
- Update types/globals.d.ts with centralized type declarations
- Use fetchData global instead of hardcoded /static/contentIndex.json
- Revert @quartz-community/types from file:../types to github:quartz-community/types
- Add .prettierignore, update .eslintrc.json with triple-slash-reference override
- Remove duplicate scripts.d.ts/styles.d.ts
Replace ambient quartz-compat.d.ts declarations with direct imports
from @quartz-community/types. Remove node_modules path from tsconfig
include array.
- Add @types/flexsearch devDependency for proper type checking
- Remove @ts-expect-error directive now that types are available
- Fixes unused directive error when plugin is installed in Quartz
- Update .eslintrc.json to ignore inline scripts and type declarations
- Change @ts-ignore to @ts-expect-error in Search.tsx
- Configure vitest aliases to mock scss and inline script imports
- Create proper test mocks and search.test.ts
- Remove template test files (emitter, filter, transformer, helpers)
- Fix formatting in search.scss