mirror of https://github.com/status-im/codimd.git
Adjust vertical rhythm 😂
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
This commit is contained in:
parent
526b5d0aa7
commit
3c8b5afe20
|
@ -12,14 +12,6 @@ const dictionaryDownloadUrls = {
|
|||
}
|
||||
}
|
||||
|
||||
const typoMap = new Map()
|
||||
|
||||
function createTypo (lang, affData, dicData) {
|
||||
const typo = new Typo(lang, affData, dicData, { platform: 'any' })
|
||||
typoMap.set(lang, typo)
|
||||
return typo
|
||||
}
|
||||
|
||||
function request (url) {
|
||||
return new Promise(resolve => {
|
||||
const req = new XMLHttpRequest()
|
||||
|
@ -47,9 +39,15 @@ function mapSeriesP (iterables, fn) {
|
|||
})
|
||||
}
|
||||
|
||||
function createTypo (lang, affData, dicData) {
|
||||
return new Typo(lang, affData, dicData, { platform: 'any' })
|
||||
}
|
||||
|
||||
const typoMap = new Map()
|
||||
|
||||
async function findOrCreateTypoInstance (lang) {
|
||||
// find existing typo instance
|
||||
const typo = typoMap.get(lang)
|
||||
let typo = typoMap.get(lang)
|
||||
if (typo) {
|
||||
return typo
|
||||
}
|
||||
|
@ -59,7 +57,10 @@ async function findOrCreateTypoInstance (lang) {
|
|||
dictionaryDownloadUrls[lang].dic
|
||||
], request)
|
||||
|
||||
return createTypo(lang, affData, dicData)
|
||||
typo = createTypo(lang, affData, dicData)
|
||||
typoMap.set(lang, typo)
|
||||
|
||||
return typo
|
||||
}
|
||||
|
||||
class CodeMirrorSpellChecker {
|
||||
|
|
Loading…
Reference in New Issue