Skip to content

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

fix: spell check not running in Obsidian

Elijah Potter62df0835332c
diff --git a/harper-wasm/src/lib.rs b/harper-wasm/src/lib.rs
index 4ce6a5cec..8e382abf5 100644
--- a/harper-wasm/src/lib.rs
+++ b/harper-wasm/src/lib.rs
@@ -29,14 +29,6 @@ pub fn setup() {
tracing_wasm::set_as_global_default();
}
-/// Configure Harper whether to include spell checking in the linting provided
-/// by the [`lint`] function.
-#[wasm_bindgen]
-pub fn use_spell_check(set: bool) {
- let mut linter = LINTER.lock().unwrap();
- linter.config.spell_check = Some(set);
-}
-
#[wasm_bindgen]
pub fn get_lint_config_as_object() -> JsValue {
let linter = LINTER.lock().unwrap();
diff --git a/packages/obsidian-plugin/src/index.js b/packages/obsidian-plugin/src/index.js
index c8e591a28..ff7b6ebcc 100644
--- a/packages/obsidian-plugin/src/index.js
+++ b/packages/obsidian-plugin/src/index.js
@@ -2,12 +2,7 @@ import logoSvg from '../logo.svg';
import { linter } from './lint';
import { Plugin, addIcon, Menu } from 'obsidian';
import wasm from 'wasm/harper_wasm_bg.wasm';
-import init, {
- lint,
- use_spell_check,
- get_lint_config_as_object,
- set_lint_config_from_object
-} from 'wasm';
+import init, { lint, get_lint_config_as_object, set_lint_config_from_object } from 'wasm';
import { HarperSettingTab } from './HarperSettingTab';
function suggestionToLabel(sug) {
@@ -29,7 +24,6 @@ const harperLinter = (plugin) =>
await init(await wasm());
- use_spell_check(false);
const lints = lint(text);
return lints.map((lint) => {