Index

HTMLSearch

MMO.core · 1 symbol · generated 5 Oct 2026

class

HTMLSearch

HTMLSearch.js:197
class MMO.core.HTMLSearch
Namespace
MMO.core

Index

constructor(nodes, threshold, scoreAttribute, updateCss)
YieldWords(text, withIndex) static generatorSplit a text into searchable words: accents stripped, lower cased, punctuation dropped.
setNodes(nodes)Replace the searched nodes, clearing whatever was highlighted before.
addNode(node)Add one node to the search.
removeNode(node)Remove a node from the search
clear()Drop every node from the search, clearing their highlights first.
clearHighlight()Remove every highlight and restore the nodes' order, visibility and score attribute.
highlight(words)Highlight node using seach words

Methods8

constructor(nodes, threshold, scoreAttribute, updateCss)

HTMLSearch.js:198
constructor(nodes = [], threshold = 0.15, scoreAttribute = 'data-score', updateCss = true)
nodes = []
threshold = 0.15
scoreAttribute = 'data-score'
updateCss = true

YieldWords(text, withIndex)

staticgeneratorHTMLSearch.js:215

Split a text into searchable words: accents stripped, lower cased, punctuation dropped.

static *YieldWords(text, withIndex = false)
textstring
withIndex = falsebooleanalso yield each word's offset in the text

setNodes(nodes)

HTMLSearch.js:236

Replace the searched nodes, clearing whatever was highlighted before.

setNodes(nodes)
nodesArray<Element | MMO.core.SearchNode>

removeNode(node)

HTMLSearch.js:260

Remove a node from the search

removeNode(node)
node
returnsvoid

clear()

HTMLSearch.js:273

Drop every node from the search, clearing their highlights first.

clear()

clearHighlight()

HTMLSearch.js:281

Remove every highlight and restore the nodes' order, visibility and score attribute.

clearHighlight()

highlight(words)

HTMLSearch.js:301

Highlight node using seach words

highlight(words)
words[type][description]
returnsnumberthe number of words sarched