Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/super-editor/src/extensions/search/SearchIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,10 @@ export class SearchIndex {
* @returns {string} Regex pattern string
*/
static toFlexiblePattern(searchString) {
// Split by whitespace, escape each part, rejoin with \s+
const parts = searchString.split(/\s+/).filter((part) => part.length > 0);
// Split by whitespace (including non-breaking spaces), escape each part, rejoin with flexible whitespace pattern
const parts = searchString.split(/[\s\u00a0]+/).filter((part) => part.length > 0);
if (parts.length === 0) return '';
return parts.map((part) => SearchIndex.escapeRegex(part)).join('\\s+');
return parts.map((part) => SearchIndex.escapeRegex(part)).join('[\\s\\u00a0]+');
}

/**
Expand Down
Loading