From ecbde2bc83376091b475e43e78e4329b6dbe5690 Mon Sep 17 00:00:00 2001 From: ville rantanen Date: Mon, 3 Jul 2017 09:35:36 +0300 Subject: [PATCH] search for headers --- index.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index b6e3e90..400679d 100644 --- a/index.html +++ b/index.html @@ -152,13 +152,26 @@ function search_hits(needle) { hitList=[]; var headName=""; for (l=0; l-1) { + /* current header matches */ + hitList.push(l); + continue + } + } var match=linkReg.exec(linkList[l].toLowerCase()); if (match != null ) { + /* matches to markdown link */ if ( match[2].indexOf(needle)>-1 ) { hitList.push(l); } continue } match=linkPlain.exec(linkList[l].toLowerCase()); if (match != null ) { + /* matches to plain link */ if ( match[2].indexOf(needle)>-1 ) { hitList.push(l); } continue } @@ -327,7 +340,7 @@ var config = {