Cybrkyd's Git Repositories

jottings - commit: 6d13713

commit 6d1371386f070c3e6845abeda9ba53d456be89affa7ec59d33056677cc49578b
author Cybrkyd <git@cybrkyd.com> 2026-06-19 15:57:30 +0100
committer Cybrkyd <git@cybrkyd.com> 2026-06-19 15:57:30 +0100
v0.4

Commit Message

Switch from nspell to Espells

📊 Diffstat

resources/js/app.js 5
1 files changed, 3 insertions(+), 2 deletions(-)

Diff

diff --git a/resources/js/app.js b/resources/js/app.js
index 1de366e..d15e29b 100644
--- a/resources/js/app.js
+++ b/resources/js/app.js
@@ -106,7 +106,7 @@ async function initSpellcheck() {
const aff = await affRes.text();
const dic = await dicRes.text();
- spell = nspell({ aff, dic });
+ spell = new espells.Espells({ aff, dic });
const ignoreMatch = aff.match(/^IGNORE\s+(\S+)/m);
ignoreChars = ignoreMatch ? ignoreMatch[1] : '';
@@ -171,7 +171,8 @@ function isCorrect(word) {
const stripped = stripIgnored(word);
if (stripped === '') return true;
if (isIgnorableNumericPossessive(word)) return true;
- return spell.correct(stripped);
+ const result = spell.lookup(stripped);
+ return result.correct && !result.forbidden;
}
function getSuggestions(word) {