prosekit/extensions/search
SearchQueryOptions
Options for defineSearchQuery
caseSensitive
Indicates whether the search is case-sensitive
Type:
boolean
Default:
false
literal
By default, string search will replace
\n
,\r
, and\t
in the query with newline, return, and tab characters. When this is set to true, that behavior is disabled.Type:
boolean
Default:
false
regexp
When true, the search string is interpreted as a regular expression.
Type:
boolean
Default:
false
replace
The replace text.
Type:
string
search
The search string (or regular expression).
Type:
string
wholeWord
Enable whole-word matching.
Type:
boolean
Default:
false
defineSearchCommands
ts
function defineSearchCommands(): Extension<{ Commands: { findNext: []; findNextNoWrap: []; findPrev: []; findPrevNoWrap: []; replaceAll: []; replaceCurrent: []; replaceNext: []; replaceNextNoWrap: [] } }>
Defines commands for search and replace.
defineSearchQuery
ts
function defineSearchQuery(options: SearchQueryOptions): PlainExtension
Defines an extension that stores a current search query and replace string.