Meta page completion fix

This commit is contained in:
Zef Hemel
2025-03-07 11:54:22 +01:00
parent fe7dcb65c4
commit e96a220e1a
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -256,6 +256,9 @@ function evalSimpleExpression(type: string, val1: any, val2: any, val3: any) {
throw new Error(`Invalid regexp: ${val2}`);
}
const r = new RegExp(val2[0], val2[1]);
if (Array.isArray(val1)) {
return val1.some((v) => r.test(v));
}
return r.test(val1);
}
case "!=~": {
+2 -2
View File
@@ -15,10 +15,10 @@ import { localDateString } from "$lib/dates.ts";
const isMetaPageFilter: QueryExpression = ["or", ["=", ["attr", "tags"], [
"string",
"template",
]], ["=", [
]], ["=~", [
"attr",
"tags",
], ["string", "meta"]]];
], ["regexp", "meta.+", ""]]];
// Completion
export async function pageComplete(completeEvent: CompleteEvent) {