mirror of
https://github.com/apple/pkl.git
synced 2026-04-01 06:33:26 +02:00
Fix broken search on pkldoc
This commit is contained in:
@@ -14,6 +14,7 @@ if (isWorker) {
|
|||||||
const searchIndexUrl = workerName === "main" ?
|
const searchIndexUrl = workerName === "main" ?
|
||||||
'../search-index.js' :
|
'../search-index.js' :
|
||||||
'../' + workerName + '/search-index.js';
|
'../' + workerName + '/search-index.js';
|
||||||
|
importScripts(searchIndexUrl);
|
||||||
initSearchIndex();
|
initSearchIndex();
|
||||||
addEventListener('message', e => {
|
addEventListener('message', e => {
|
||||||
const {query, packageName, moduleName, className} = e.data;
|
const {query, packageName, moduleName, className} = e.data;
|
||||||
@@ -177,12 +178,11 @@ function toWordStarts(characters) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const regexIsUppercase = /\p{Lu}/u
|
|
||||||
|
|
||||||
const regexIsNumericCharacter = /\p{N}/u
|
|
||||||
|
|
||||||
// Partitions characters into uppercase, digit, dot, and other.
|
// Partitions characters into uppercase, digit, dot, and other.
|
||||||
function toCharClass(ch) {
|
function toCharClass(ch) {
|
||||||
|
const regexIsUppercase = /\p{Lu}/u
|
||||||
|
const regexIsNumericCharacter = /\p{N}/u
|
||||||
return regexIsUppercase.test(ch) ? 3 : regexIsNumericCharacter.test(ch) ? 2 : ch === '.' ? 1 : 0;
|
return regexIsUppercase.test(ch) ? 3 : regexIsNumericCharacter.test(ch) ? 2 : ch === '.' ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ if (isWorker) {
|
|||||||
const searchIndexUrl = workerName === "main" ?
|
const searchIndexUrl = workerName === "main" ?
|
||||||
'../search-index.js' :
|
'../search-index.js' :
|
||||||
'../' + workerName + '/search-index.js';
|
'../' + workerName + '/search-index.js';
|
||||||
|
importScripts(searchIndexUrl);
|
||||||
initSearchIndex();
|
initSearchIndex();
|
||||||
addEventListener('message', e => {
|
addEventListener('message', e => {
|
||||||
const {query, packageName, moduleName, className} = e.data;
|
const {query, packageName, moduleName, className} = e.data;
|
||||||
@@ -177,12 +178,11 @@ function toWordStarts(characters) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const regexIsUppercase = /\p{Lu}/u
|
|
||||||
|
|
||||||
const regexIsNumericCharacter = /\p{N}/u
|
|
||||||
|
|
||||||
// Partitions characters into uppercase, digit, dot, and other.
|
// Partitions characters into uppercase, digit, dot, and other.
|
||||||
function toCharClass(ch) {
|
function toCharClass(ch) {
|
||||||
|
const regexIsUppercase = /\p{Lu}/u
|
||||||
|
const regexIsNumericCharacter = /\p{N}/u
|
||||||
return regexIsUppercase.test(ch) ? 3 : regexIsNumericCharacter.test(ch) ? 2 : ch === '.' ? 1 : 0;
|
return regexIsUppercase.test(ch) ? 3 : regexIsNumericCharacter.test(ch) ? 2 : ch === '.' ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user