Meta page completion fix
This commit is contained in:
@@ -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 "!=~": {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user