mirror of
https://github.com/ansible-collections/community.routeros.git
synced 2025-07-04 23:34:39 +02:00
deploy: 5ee2af49b8
This commit is contained in:
parent
687d5cd5b6
commit
a2a1f45a28
3 changed files with 6 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Sphinx build info version 1
|
# Sphinx build info version 1
|
||||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||||
config: 9a17ea2b03ea77011284d03100e164d0
|
config: 07835feff396de41280004f35106b46c
|
||||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
||||||
|
|
|
@ -178,7 +178,7 @@ const Search = {
|
||||||
|
|
||||||
htmlToText: (htmlString, anchor) => {
|
htmlToText: (htmlString, anchor) => {
|
||||||
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
|
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
|
||||||
for (const removalQuery of [".headerlinks", "script", "style"]) {
|
for (const removalQuery of [".headerlink", "script", "style"]) {
|
||||||
htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() });
|
htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() });
|
||||||
}
|
}
|
||||||
if (anchor) {
|
if (anchor) {
|
||||||
|
@ -328,13 +328,14 @@ const Search = {
|
||||||
for (const [title, foundTitles] of Object.entries(allTitles)) {
|
for (const [title, foundTitles] of Object.entries(allTitles)) {
|
||||||
if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) {
|
if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) {
|
||||||
for (const [file, id] of foundTitles) {
|
for (const [file, id] of foundTitles) {
|
||||||
let score = Math.round(100 * queryLower.length / title.length)
|
const score = Math.round(Scorer.title * queryLower.length / title.length);
|
||||||
|
const boost = titles[file] === title ? 1 : 0; // add a boost for document titles
|
||||||
normalResults.push([
|
normalResults.push([
|
||||||
docNames[file],
|
docNames[file],
|
||||||
titles[file] !== title ? `${titles[file]} > ${title}` : title,
|
titles[file] !== title ? `${titles[file]} > ${title}` : title,
|
||||||
id !== null ? "#" + id : "",
|
id !== null ? "#" + id : "",
|
||||||
null,
|
null,
|
||||||
score,
|
score + boost,
|
||||||
filenames[file],
|
filenames[file],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue