Skip to content

Commit

Permalink
fix: Make sure cspell-tool-cli keeps accents
Browse files Browse the repository at this point in the history
In `--split` mode, the compiler would loose free floating accents.
  • Loading branch information
Jason3S committed Feb 1, 2022
1 parent bb9baaa commit 6302b6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/cspell-tools/src/compiler/wordListCompiler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ describe('Validate the wordListCompiler', () => {
${'Namespace DNSLookup'} | ${['Namespace', 'DNSLookup']} | ${true} | ${true}
${'well-educated'} | ${['well-educated']} | ${true} | ${true}
${'--abort-on-uncaught-exception'} | ${['--abort-on-uncaught-exception']} | ${true} | ${true}
${'corner cafe\u0301\u0304'} | ${['corner café\u0304']} | ${false} | ${true}
${'corner café'} | ${['café', 'corner']} | ${true} | ${true}
${'corner café'.normalize('NFD')} | ${['café', 'corner']} | ${true} | ${true}
${'corner café\u0304'.normalize('NFD')} | ${['café\u0304', 'corner']} | ${true} | ${true}
${'El Niño'} | ${['El', 'Niño']} | ${true} | ${true}
${'El Nin\u0303o'} | ${['El', 'Niño']} | ${true} | ${true}
${'CURLcode'} | ${['CURLcode']} | ${true} | ${true}
Expand Down
4 changes: 2 additions & 2 deletions packages/cspell-tools/src/compiler/wordListCompiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { writeSeqToFile } from './fileWriter';
import { uniqueFilter } from 'hunspell-reader/dist/util';
import { extractInlineSettings, InlineSettings } from './inlineSettings';

const regNonWordOrSpace = /[^\p{L}' ]+/giu;
const regNonWordOrDigit = /[^\p{L}'\w-]+/giu;
const regNonWordOrSpace = /[^\p{L}\p{M}' ]+/giu;
const regNonWordOrDigit = /[^\p{L}\p{M}'\w-]+/giu;
const regExpSpaceOrDash = /[- ]+/g;
const regExpRepeatChars = /(.)\1{4,}/i;

Expand Down

0 comments on commit 6302b6e

Please sign in to comment.