Skip to content

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

fix: minor issues with demo

Elijah Potter36369c1ba301
diff --git a/demo.md b/demo.md
index 4affbb7a5..a74dcccbf 100644
--- a/demo.md
+++ b/demo.md
@@ -8,7 +8,7 @@ Like if you break up words you shouldn't.
Harper works everywhere, even offline. Since you r data
never leaves your device, you don't ned to worry aout us
-selling it or using it to train LLMs.
+selling it or using it to train large language models.
The best part: Harper can give you feedback instantly.
For most documents, Harper can serve up suggestions in
diff --git a/harper-core/dictionary.dict b/harper-core/dictionary.dict
index 841a644f4..8a63c515e 100644
--- a/harper-core/dictionary.dict
+++ b/harper-core/dictionary.dict
@@ -49654,3 +49654,4 @@ scatterplot/SMG14
Wikilink/MS1
stacktrace/SM1
scrollbar/SM1
+break-up/SM1
diff --git a/harper-core/src/linting/matcher.rs b/harper-core/src/linting/matcher.rs
index e340043dc..05f1c4c0b 100644
--- a/harper-core/src/linting/matcher.rs
+++ b/harper-core/src/linting/matcher.rs
@@ -186,8 +186,6 @@ impl Matcher {
"that","s" => "that is",
"That","s" => "that is",
"ms" => "milliseconds",
- "LLM" => "large language model",
- "LLMs" => "large language models",
"t","he" => "the",
"the","hing" => "the thing",
"The","hing" => "The thing",
diff --git a/harper-wasm/src/lib.rs b/harper-wasm/src/lib.rs
index 8e382abf5..fa9859fed 100644
--- a/harper-wasm/src/lib.rs
+++ b/harper-wasm/src/lib.rs
@@ -10,12 +10,10 @@ use wasm_bindgen::prelude::wasm_bindgen;
use wasm_bindgen::JsValue;
static LINTER: Lazy<Mutex<LintGroup<Lrc<FullDictionary>>>> = Lazy::new(|| {
- let lint_config = LintGroupConfig {
- spell_check: Some(false),
- ..Default::default()
- };
-
- Mutex::new(LintGroup::new(lint_config, FullDictionary::curated()))
+ Mutex::new(LintGroup::new(
+ LintGroupConfig::default(),
+ FullDictionary::curated()
+ ))
});
/// Setup the WebAssembly module's logging.
diff --git a/packages/obsidian-plugin/src/index.js b/packages/obsidian-plugin/src/index.js
index ff7b6ebcc..f4784edd2 100644
--- a/packages/obsidian-plugin/src/index.js
+++ b/packages/obsidian-plugin/src/index.js
@@ -83,7 +83,10 @@ export default class HarperPlugin extends Plugin {
async getSettings() {
await init(await wasm());
this.lintSettingChanged();
- return { lintSettings: await get_lint_config_as_object() };
+
+ let lintSettings = await get_lint_config_as_object();
+
+ return { lintSettings };
}
/** @public
@@ -91,6 +94,19 @@ export default class HarperPlugin extends Plugin {
* @returns {Promise<void>} */
async setSettings(settings) {
await init(await wasm());
+
+ if (settings == null) {
+ settings = {};
+ }
+
+ if (settings.lintSettings == undefined) {
+ settings.lintSettings = {};
+ }
+
+ if (settings.lintSettings.spell_check == undefined) {
+ settings.lintSettings.spell_check = false;
+ }
+
set_lint_config_from_object(settings.lintSettings);
this.lintSettingChanged();
this.saveData(settings);