Support for non-latin characters in heading anchor links (#492)

This commit is contained in:
Sviatoslav 2018-04-17 19:33:10 +03:00 committed by Joel Marcey
parent ba024a25c7
commit 1642c078a7
3 changed files with 29 additions and 2 deletions

View file

@ -0,0 +1,14 @@
const toSlug = require('../toSlug');
[
['Hello world! ', 'hello-world'],
['React 16', 'react-16'],
['Hello. // (world?)! ', 'hello-world'],
['Привет мир! ', 'привет-мир'],
['Über Café.', 'uber-cafe'],
['Someting long ...', 'someting-long-'],
].forEach(([input, output]) => {
test(`toSlug('${input}') -> '${output}'`, () => {
expect(toSlug(input)).toBe(output);
});
});