find-and-replace/utils
@ckeditor/ckeditor5-find-and-replace/src/utils
Filtering
Functions
-
findByTextCallback( searchTerm, [ options ] = { [options.matchCase], [options.wholeWords] } ) → function
module:find-and-replace/utils~findByTextCallback
Creates a text matching callback for a specified search term and matching options.
Parameters
searchTerm : String
The search term.
[ options ] : Object
Matching options.
Properties[ options.matchCase ] : Boolean
If set to
true
letter casing will be ignored.Defaults to
false
[ options.wholeWords ] : Boolean
If set to
true
only whole words that matchcallbackOrText
will be matched.Defaults to
false
Returns
function
-
rangeToText( range ) → String
module:find-and-replace/utils~rangeToText
Returns text representation of a range. The returned text length should be the same as range length. In order to achieve this this function will replace inline elements (text-line) as new line character ("\n").
Parameters
range : Range
The model range.
Returns
String
The text content of the provided range.
-
updateFindResultFromRange( range, model, findCallback, [ startResults ] ) → Collection
module:find-and-replace/utils~updateFindResultFromRange
Executes findCallback and updates search results list.
Parameters
range : Range
The model range to scan for matches.
model : Model
The model.
findCallback : function
The callback that should return
true
if provided text matches the search term.[ startResults ] : Collection
An optional collection of find matches that the function should start with. This would be a collection returned by a previous
updateFindResultFromRange()
call.
Returns
Collection
A collection of objects describing find match.
An example structure:
{ id: resultId, label: foundItem.label, marker }
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.