🚀 Socket Launch Week 🚀 Day 5: Introducing Socket Fix.Learn More

gitbook-plugin-search-plus

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitbook-plugin-search-plus - npm Package Compare versions

Comparing version

to
0.0.10

@@ -180,8 +180,13 @@ require([

var highLightPageInner = function(keyword) {
var reg = new RegExp('(>[^<]*)(' + escapeReg(keyword) + ')', 'igm');
$('.page-inner').html($('.page-inner').html().replace(reg, '$1<span class="search-highlight search-highlight-keyword">$2</span>'));
$('.page-inner').mark(keyword, {
'ignoreJoiners': true,
'acrossElements': true,
'separateWordSearch': false
});
setTimeout(function() {
// 定位到第一个高亮词
$('.search-highlight')[0].scrollIntoView();
var mark = $('mark[data-markjs="true"]');
if (mark.length) {
mark[0].scrollIntoView();
}
}, 100);

@@ -188,0 +193,0 @@ };

@@ -12,2 +12,3 @@ var Entities = require('html-entities').AllHtmlEntities;

js: [
'jquery.mark.min.js',
'search.js'

@@ -14,0 +15,0 @@ ],

{
"name": "gitbook-plugin-search-plus",
"version": "0.0.9",
"version": "0.0.10",
"description": "gitbook powerful search plugin",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"start": "cd examples&&npm install&&npm start",
"test": "echo \"Error: no test specified\" && exit 1",
"add": "git add -A",
"pages:build": "cd examples&&npm install&&npm run build"
},

@@ -19,2 +22,9 @@ "repository": {

},
"devDependencies": {
"pre-commit": "^1.2.2"
},
"pre-commit": {
"run": ["pages:build", "add"],
"silent": true
},
"author": "lwdgit",

@@ -26,2 +36,2 @@ "license": "Apache-2.0",

"homepage": "https://github.com/lwdgit/gitbook-plugin-search-plus#readme"
}
}