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) {