forked from vuejs/vuepress
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(-utils): use String.normalize to generate slugs (vuejs#1815)
- Loading branch information
Showing
4 changed files
with
59 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import slugify from '../src/slugify' | ||
|
||
describe('slugify', () => { | ||
test('should slugify', () => { | ||
const asserts: Record<string, string> = { | ||
'Привет': 'привет', | ||
'Лед üäöß': 'лед-uaoß', | ||
'Iлtèrnåtïonɑlíƶatï߀ԉ': 'iлternationɑliƶati߀ԉ', | ||
'Båcòл ípѕùm ðoɭ߀r ѕït aϻèt âùþê aԉᏧ߀üïlɭê ƃëéf culρá fïlèt ϻiǥnòn cuρiᏧatat ut êлim tòлɢùê.': | ||
'bacoл-ipѕum-ðoɭ߀r-ѕit-aϻet-auþe-aԉꮷ߀uilɭe-ƃeef-culρa-filet-ϻiǥnon-cuρiꮷatat-ut-eлim-toлɢue', | ||
'ᴎᴑᴅᴇȷʂ': 'ᴎᴑᴅᴇȷʂ', | ||
'hambúrguer': 'hamburguer', | ||
'hŒllœ': 'hœllœ', | ||
'Fußball': 'fußball', | ||
'ABCDEFGHIJKLMNOPQRSTUVWXYZé': 'abcdefghijklmnopqrstuvwxyze', | ||
} | ||
|
||
Object.keys(asserts).forEach(input => { | ||
expect(slugify(input)).toBe(asserts[input]) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1837,15 +1837,16 @@ autoprefixer@^6.3.1: | |
postcss "^5.2.16" | ||
postcss-value-parser "^3.2.3" | ||
|
||
autoprefixer@^8.2.0: | ||
version "8.6.5" | ||
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-8.6.5.tgz#343f3d193ed568b3208e00117a1b96eb691d4ee9" | ||
autoprefixer@^7.1.2: | ||
version "7.2.6" | ||
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-7.2.6.tgz#256672f86f7c735da849c4f07d008abb056067dc" | ||
integrity sha512-Iq8TRIB+/9eQ8rbGhcP7ct5cYb/3qjNYAR2SnzLCEcwF6rvVOax8+9+fccgXk4bEhQGjOZd5TLhsksmAdsbGqQ== | ||
dependencies: | ||
browserslist "^3.2.8" | ||
caniuse-lite "^1.0.30000864" | ||
browserslist "^2.11.3" | ||
caniuse-lite "^1.0.30000805" | ||
normalize-range "^0.1.2" | ||
num2fraction "^1.2.2" | ||
postcss "^6.0.23" | ||
postcss "^6.0.17" | ||
postcss-value-parser "^3.2.3" | ||
|
||
aws-sign2@~0.7.0: | ||
|
@@ -2247,12 +2248,13 @@ browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6: | |
caniuse-db "^1.0.30000639" | ||
electron-to-chromium "^1.2.7" | ||
|
||
browserslist@^3.2.8: | ||
version "3.2.8" | ||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" | ||
browserslist@^2.11.3: | ||
version "2.11.3" | ||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.11.3.tgz#fe36167aed1bbcde4827ebfe71347a2cc70b99b2" | ||
integrity sha512-yWu5cXT7Av6mVwzWc8lMsJMHWn4xyjSuGYi4IozbVTLUOEYPSagUB8kiMDUHA1fS3zjr8nkxkn9jdvug4BBRmA== | ||
dependencies: | ||
caniuse-lite "^1.0.30000844" | ||
electron-to-chromium "^1.3.47" | ||
caniuse-lite "^1.0.30000792" | ||
electron-to-chromium "^1.3.30" | ||
|
||
browserslist@^4.1.0: | ||
version "4.3.4" | ||
|
@@ -2447,9 +2449,10 @@ caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639: | |
version "1.0.30000864" | ||
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000864.tgz#35a4b2325a8d4553a46b516dbc233bf391d75555" | ||
|
||
caniuse-lite@^1.0.30000844, caniuse-lite@^1.0.30000864: | ||
version "1.0.30000864" | ||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000864.tgz#7a08c78da670f23c06f11aa918831b8f2dd60ddc" | ||
caniuse-lite@^1.0.30000792, caniuse-lite@^1.0.30000805: | ||
version "1.0.30000989" | ||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000989.tgz#b9193e293ccf7e4426c5245134b8f2a56c0ac4b9" | ||
integrity sha512-vrMcvSuMz16YY6GSVZ0dWDTJP8jqk3iFQ/Aq5iqblPwxSVVZI+zxDyTX0VPqtQsDnfdrBDcsmhgTEOh5R8Lbpw== | ||
|
||
caniuse-lite@^1.0.30000899: | ||
version "1.0.30000906" | ||
|
@@ -3514,10 +3517,6 @@ dezalgo@^1.0.0: | |
asap "^2.0.0" | ||
wrappy "1" | ||
|
||
diacritics@^1.3.0: | ||
version "1.3.0" | ||
resolved "https://registry.yarnpkg.com/diacritics/-/diacritics-1.3.0.tgz#3efa87323ebb863e6696cebb0082d48ff3d6f7a1" | ||
|
||
diff@^3.2.0: | ||
version "3.5.0" | ||
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" | ||
|
@@ -3655,10 +3654,15 @@ [email protected]: | |
version "1.1.1" | ||
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" | ||
|
||
electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.47: | ||
electron-to-chromium@^1.2.7: | ||
version "1.3.51" | ||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.51.tgz#6a42b49daaf7f22a5b37b991daf949f34dbdb9b5" | ||
|
||
electron-to-chromium@^1.3.30: | ||
version "1.3.256" | ||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.256.tgz#7f680d5f04df8e2bd9cb9758026d70f5ff1808a9" | ||
integrity sha512-GHY1r2mO56BRMng6rkxxJvsWKtqy9k/IlSBrAV/VKwZKpTydVUJnOwajTNnl5uutJpthHgZy+HeofK5K6PqEgQ== | ||
|
||
electron-to-chromium@^1.3.82: | ||
version "1.3.83" | ||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.83.tgz#74584eb0972bb6777811c5d68d988c722f5e6666" | ||
|
@@ -6498,6 +6502,13 @@ lru-cache@^4.1.3: | |
pseudomap "^1.0.2" | ||
yallist "^2.1.2" | ||
|
||
lru-cache@^5.1.1: | ||
version "5.1.1" | ||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" | ||
integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== | ||
dependencies: | ||
yallist "^3.0.2" | ||
|
||
make-dir@^1.0.0: | ||
version "1.3.0" | ||
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" | ||
|
@@ -7999,7 +8010,7 @@ postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0 | |
source-map "^0.5.6" | ||
supports-color "^3.2.3" | ||
|
||
postcss@^6.0.0, postcss@^6.0.20, postcss@^6.0.23: | ||
postcss@^6.0.0, postcss@^6.0.17, postcss@^6.0.20: | ||
version "6.0.23" | ||
resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.23.tgz#61c82cc328ac60e677645f979054eb98bc0e3324" | ||
dependencies: | ||
|