diff --git a/docs_v1.0/doc_wasm/index.html b/docs_v1.0/doc_wasm/index.html index b75bf52..51e8803 100644 --- a/docs_v1.0/doc_wasm/index.html +++ b/docs_v1.0/doc_wasm/index.html @@ -146,6 +146,12 @@ function escapeHtml(s) { return s.replace(/&/g,'&').replace(//g,'>'); } +function highlightText(text, query) { + var escaped = escapeHtml(text); + var re = new RegExp('(' + query.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + ')', 'gi'); + return escaped.replace(re, '$1'); +} + async function fulltextSearch(q) { el.innerHTML = '
Searching...
'; var results = []; @@ -173,7 +179,7 @@ async function fulltextSearch(q) { html += ''
+ r.module + ' ' + escapeHtml(r.title) + ' line ' + r.line + '
'
+ '