diff --git a/src/js/vendor/search.bundle.js b/src/js/vendor/search.bundle.js index c12843a..1d0765d 100644 --- a/src/js/vendor/search.bundle.js +++ b/src/js/vendor/search.bundle.js @@ -2,7 +2,7 @@ ;(function () { const isMac = () => navigator.platform.indexOf('Mac') > -1 - + let loaded = false const config = document.getElementById('search-script').dataset const client = algoliasearch(config.appId, config.apiKey) let selected = null @@ -14,6 +14,10 @@ let lastRenderArgs + const decodeHtmlEntities = (str) => { + return str.replaceAll('&lt;', '<').replaceAll('&gt;', '>') + } + const infiniteHits = instantsearch.connectors.connectInfiniteHits((renderArgs, isFirstRender) => { const { hits, showMore, widgetParams } = renderArgs const { container } = widgetParams @@ -80,14 +84,13 @@ .filter((item) => !!item) .join(' - ') - console.log(label) return `
  • - ${label} + ${decodeHtmlEntities(label)}
    - ${breadcrumbs} - ${content} + ${decodeHtmlEntities(breadcrumbs)} + ${decodeHtmlEntities(content)}
  • ` }) @@ -219,9 +222,11 @@ }), ]) - search.start() - const open = () => { + if (!loaded) { + search.start() + loaded = true + } selectHit(null) MicroModal.show('modal-1', { disableScroll: true,