From ed9a8efd1ff4ee569fa4256e044151670abaea82 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Fri, 06 May 2022 01:11:23 +0000
Subject: [PATCH] fix inline link highlighting, safer latex render

---
 assets/js/search.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/assets/js/search.js b/assets/js/search.js
index 195a40b..bb94cd3 100644
--- a/assets/js/search.js
+++ b/assets/js/search.js
@@ -38,8 +38,8 @@
       .replace(/(#{1,6})\s+(.+)\1?/g, '<b>$2</b>')
       .replace(/\s{0,2}\[.*?\]: .*?$/g, '')
       .replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g, options.useImgAltText ? '$1' : '')
-      .replace(/\[(.*?)\][\[\(].*?[\]\)]/g, '$1')
-      .replace(/!?\[\[\S[^\[\]\|]*(?:\|([^\[\]]*))?\S\]\]/g, '$1')
+      .replace(/\[(.*?)\][\[\(].*?[\]\)]/g, '<a>$1</a>')
+      .replace(/!?\[\[\S[^\[\]\|]*(?:\|([^\[\]]*))?\S\]\]/g, '<a>$1</a>')
       .replace(/^\s{0,3}>\s?/g, '')
       .replace(/(^|\n)\s{0,3}>\s?/g, '\n\n')
       .replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g, '')

--
Gitblit v1.10.0