Skip to content

Commit

Permalink
Add experimental spellchecker (marktext#1424)
Browse files Browse the repository at this point in the history
* Experimental spellchecker for testing purpose

* Fix 'apache' license validation

* Use local electron-spellchecker for development

* Add settings and bug fixes

* Fix Hunspell switchLanguage bug and improvements

* Fix attach to editor when enabling spell check again

* Add Hunspell license

* Copy default Huspell dictionary on first start

* Fix full language name

* Some code improvements

* Allow to add words to user dict and  bug fixes

* Allow to change Muya's spellcheck container attribute

* feat: Don't underline misspelled words

* Allow to set Hunspell on macOS

* Fix spellchecker changed value

* Refactor switchLanguage, init and enableSpellchecker

* Refactor and some fixes

* Code improvements

* electron-spellchecker cleanup and optimization

* Disable automatic language detection for Hunspell

* Fix init on macOS and update JSDoc

* Fix macOS issues and some improvements

* Load single settings value only

* Fix rebase

* Remove debug code

* Move electron-spellchecker to scoped npm repo

* Fix dictionary of ignored words on macOS

* Move replaceWordInline to core API

* Remove comment block

* Fix upstream lint error
  • Loading branch information
fxha authored and Jocs committed Oct 17, 2019
1 parent 1b9ee78 commit 603ed04
Show file tree
Hide file tree
Showing 46 changed files with 5,516 additions and 946 deletions.
2 changes: 1 addition & 1 deletion .electron-vue/thirdPartyChecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const getLicenses = (rootDir, callback) => {
direct: true,
excludePackages: 'xmldom@0.1.27', // xmldom@0.1.27 is under MIT License, but license-checker show it's under LGPL License.
json: true,
onlyAllow: 'Unlicense;WTFPL;ISC;MIT;BSD;ISC;Apache-2.0;MIT*;Apache*;BSD*;CC0-1.0;CC-BY-4.0;CC-BY-3.0',
onlyAllow: 'Unlicense;WTFPL;ISC;MIT;BSD;ISC;Apache-2.0;MIT*;Apache;Apache*;BSD*;CC0-1.0;CC-BY-4.0;CC-BY-3.0',
customPath: {
licenses: '',
licenseText: 'none'
Expand Down
17 changes: 17 additions & 0 deletions electron-builder.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,31 @@ files:
- "!node_modules/terser/dist/bundle.min.js.map"
- "!node_modules/vega-lite/build/vega-lite*.js.map"
# Don't bundle build files
- "!node_modules/@felixrieseberg/spellchecker/bin"
- "!node_modules/ced/bin"
- "!node_modules/ced/vendor"
- "!node_modules/cld/bin"
- "!node_modules/cld/deps"
- "!node_modules/fontmanager-redux/bin"
- "!node_modules/keyboard-layout/bin"
- "!node_modules/keytar/bin"
- "!node_modules/vscode-windows-registry/bin"
# Don't bundle Windows build files
- "!node_modules/**/{*.vcxproj,*.vcxproj.filters}"
- "!node_modules/**/build/Release/{*.lib,*.exp,*.ilk,*.pdb}"
- "!node_modules/**/build/Release/obj"
- "!node_modules/ced/build/vendor"
# Don't bundle LGPL source files
- "!node_modules/@felixrieseberg/spellchecker/vendor"
extraFiles:
- "LICENSE"
- from: "resources/THIRD-PARTY-LICENSES.txt"
to: "THIRD-PARTY-LICENSES.txt"
extraResources:
- from: "resources/hunspell_dictionaries/"
to: "hunspell_dictionaries/"
filter:
- "!**/LICENSE-hunspell.txt"

fileAssociations:
- ext:
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build:bin": "node .electron-vue/build.js && electron-builder --dir",
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
"build:dev": "node .electron-vue/build.js",
"dev": "node .electron-vue/dev-runner.js",
"dev": "cross-env node .electron-vue/dev-runner.js",
"e2e": "yarn run pack && cross-env MARKTEXT_EXIT_ON_ERROR=1 mocha --timeout 10000 test/e2e",
"lint": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter src test",
"lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src test",
Expand All @@ -28,12 +28,13 @@
"preinstall": "node .electron-vue/preinstall.js",
"build:muya": "cd src/muya && webpack --progress --colors --config webpack.config.js",
"release:muya": "yarn run build:muya && cd src/muya && yarn publish",
"rebuild": "electron-rebuild -f -o fontmanager-redux,keytar,keyboard-layout,vscode-windows-registry",
"rebuild": "electron-rebuild -f",
"gen-third-party": "node tools/generateThirdPartyLicense.js",
"validate-licenses": "node tools/validateLicenses.js"
},
"dependencies": {
"@hfelix/electron-localshortcut": "^3.1.1",
"@hfelix/electron-spellchecker": "^1.0.0-rc.1",
"@octokit/rest": "^16.33.1",
"arg": "^4.1.1",
"axios": "^0.19.0",
Expand All @@ -60,6 +61,7 @@
"github-markdown-css": "^3.0.1",
"html-tags": "^3.0.0",
"iconv-lite": "^0.5.0",
"iso-639-1": "^2.1.0",
"joplin-turndown-plugin-gfm": "^1.0.11",
"katex": "^0.11.1",
"keyboard-layout": "^2.0.16",
Expand Down
Loading

0 comments on commit 603ed04

Please sign in to comment.