Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

feat(harper-typst): ignore regex as well

Donny Kim97569c7f6ff6
diff --git a/harper-typst/src/typst_translator.rs b/harper-typst/src/typst_translator.rs
index 65383fe8b..299f6e798 100644
--- a/harper-typst/src/typst_translator.rs
+++ b/harper-typst/src/typst_translator.rs
@@ -230,6 +230,7 @@ impl<'a> TypstTranslator<'a> {
"std.cite" | "cite" => parse_args_without(true, &["style"]),
"std.raw" | "raw" => parse_args_without(false, &["syntaxes", "theme"]),
"std.image" | "image" => parse_args_without(true, &[]),
+ "std.regex" | "regex" => parse_args_without(true, &[]),
_ => parse_args(&mut func.args().items()),
}
]
diff --git a/harper-typst/tests/test_sources/function_with_ignorable_args.typ b/harper-typst/tests/test_sources/function_with_ignorable_args.typ
index 233381832..1e15772be 100644
--- a/harper-typst/tests/test_sources/function_with_ignorable_args.typ
+++ b/harper-typst/tests/test_sources/function_with_ignorable_args.typ
@@ -4,6 +4,7 @@
#cite(style: "../a.csl", supplement: [Errorz])
#raw(syntaxes: ("../a", "../b"), theme: "../c", [Errorz])
#image("../a", caption: [Errorz])
+#regex("(?i)")
#std.rgb("ffffff")
#color.rgb("ffffff")
#std.plugin("../a.wasm")
@@ -11,3 +12,4 @@
#std.cite(style: "../a.csl", supplement: [Errorz])
#std.raw(syntaxes: ("../a", "../b"), theme: "../c", [Errorz])
#std.image("../a", caption: [Errorz])
+#std.regex("(?i)")