mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
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 = {
|
||||
|
||||
@@ -47,6 +47,7 @@ html(
|
||||
//- See: https://webpack.js.org/guides/public-path/#on-the-fly
|
||||
meta(name="ol-baseAssetPath" content=buildBaseAssetPath())
|
||||
meta(name="ol-mathJaxPath" content=mathJaxPath)
|
||||
meta(name="ol-dictionariesRoot" content=dictionariesRoot)
|
||||
|
||||
meta(name="ol-usersEmail" content=getUserEmail())
|
||||
meta(name="ol-ab" data-type="json" content={})
|
||||
|
||||
Reference in New Issue
Block a user