Aiden Bai
2022-05-03 e4cc625c33ecd2992dcf60f408417c3067b4fa2b
assets/js/search.js
@@ -35,6 +35,7 @@
      .replace(/<[^>]*>/g, '')
      .replace(/^[=\-]{2,}\s*$/g, '')
      .replace(/\[\^.+?\](\: .*?$)?/g, '')
      .replace(/(#{1,6})\s+(.+)\1?/g, '<b>$2</b>')
      .replace(/\s{0,2}\[.*?\]: .*?$/g, '')
      .replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g, options.useImgAltText ? '$1' : '')
      .replace(/\[(.*?)\][\[\(].*?[\]\)]/g, '$1')
@@ -143,7 +144,7 @@
    // SPA navigation
    window.navigate(
      new URL(
        `${BASE_URL.slice(0, -1)}${id}#:~:text=${encodeURIComponent(term)}/`
        `${BASE_URL}${id}#:~:text=${encodeURIComponent(term)}/`
      ),
      '.singlePage'
    )