Use Hunspell for client-side spellchecking (#20286)
GitOrigin-RevId: c4d0d9e06fe0cc9d7cb7a058fd0768eb024e44f5
This commit is contained in:
@@ -79,6 +79,7 @@ async function joinProject(req, res, next) {
|
||||
// disable spellchecking for currently unsupported spell check languages
|
||||
// preserve the value in the db so they can use it again once we add back
|
||||
// support.
|
||||
// TODO: allow these if in client-side spell check split test
|
||||
if (
|
||||
unsupportedSpellcheckLanguages.indexOf(project.spellCheckLanguage) !== -1
|
||||
) {
|
||||
|
||||
@@ -340,6 +340,7 @@ const _ProjectController = {
|
||||
'ieee-stylesheet',
|
||||
'write-and-cite',
|
||||
'default-visual-for-beginners',
|
||||
'spell-check-client',
|
||||
].filter(Boolean)
|
||||
|
||||
const getUserValues = async userId =>
|
||||
|
||||
@@ -7,7 +7,7 @@ const LearnedWordsManager = require('./LearnedWordsManager')
|
||||
const TEN_SECONDS = 1000 * 10
|
||||
|
||||
const languageCodeIsSupported = code =>
|
||||
Settings.languages.some(lang => lang.code === code)
|
||||
Settings.languages.some(lang => lang.code === code && lang.server !== false)
|
||||
|
||||
module.exports = {
|
||||
learn(req, res, next) {
|
||||
|
||||
@@ -174,6 +174,7 @@ module.exports = function (webRouter, privateApiRouter, publicApiRouter) {
|
||||
}
|
||||
|
||||
res.locals.mathJaxPath = `/js/libs/mathjax-${PackageVersions.version.mathjax}/es5/tex-svg-full.js`
|
||||
res.locals.dictionariesRoot = `/js/dictionaries/${PackageVersions.version.dictionaries}/`
|
||||
|
||||
res.locals.lib = PackageVersions.lib
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const version = {
|
||||
mathjax: '3.2.2',
|
||||
dictionaries: '0.0.2',
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user