goog.dom.annotate
Functions
annotateTerms( node, terms, annotateFn, opt_ignoreCase, opt_classesToSkip, opt_maxMs ) → boolean
boolean
Calls annotateFn
for each occurrence of a search term in text nodes
under node
. Returns the number of hits.
Parameters |
| ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
annotateText( text, terms, annotateFn, opt_ignoreCase ) → (goog.html.SafeHtml|null)
(goog.html.SafeHtml|null)
Annotates occurrences of query terms in plain text. This process consists of identifying all occurrences of all query terms, calling a provided function to get the appropriate replacement HTML for each occurrence, and HTML-escaping all the text.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Properties
AnnotateFn → function(number, goog.html.SafeHtml): goog.html.SafeHtml
function(number, goog.html.SafeHtml): goog.html.SafeHtml
A function that takes: (1) the number of the term that is "hit", (2) the HTML (search term) to be annotated, and returns the annotated term as an HTML.