33/* global Mark, elasticlunr, path_to_root */
44
55window . search = window . search || { } ;
6- ( function search ( search ) {
6+ ( function search ( ) {
77 // Search functionality
88 //
99 // You can use !hasFocus() to prevent keyhandling in your key
@@ -29,7 +29,8 @@ window.search = window.search || {};
2929 searchicon = document . getElementById ( 'search-toggle' ) ,
3030 content = document . getElementById ( 'content' ) ,
3131
32- mark_exclude = [ ] ,
32+ // SVG text elements don't render if inside a <mark> tag.
33+ mark_exclude = [ 'text' ] ,
3334 marker = new Mark ( content ) ,
3435 URL_SEARCH_PARAM = 'search' ,
3536 URL_MARK_PARAM = 'highlight' ,
@@ -288,6 +289,9 @@ window.search = window.search || {};
288289
289290 // If reloaded, do the search or mark again, depending on the current url parameters
290291 doSearchOrMarkFromUrl ( ) ;
292+
293+ // Exported functions
294+ config . hasFocus = hasFocus ;
291295 }
292296
293297 function unfocusSearchbar ( ) {
@@ -521,6 +525,4 @@ window.search = window.search || {};
521525
522526 loadScript ( path_to_root + 'searchindex.js' , 'search-index' ) ;
523527
524- // Exported functions
525- search . hasFocus = hasFocus ;
526528} ) ( window . search ) ;
0 commit comments