mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Make _.deburr handle combining diacritical marks. [closes #1070]
This commit is contained in:
@@ -87,6 +87,13 @@
|
||||
reEvaluate = /<%([\s\S]+?)%>/g,
|
||||
reInterpolate = /<%=([\s\S]+?)%>/g;
|
||||
|
||||
/**
|
||||
* Used to match combining diacritical marks.
|
||||
* See [Wikipedia](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks)
|
||||
* for more details.
|
||||
*/
|
||||
var reComboMarks = /[\u0300-\u036f\ufe20-\ufe23]/g;
|
||||
|
||||
/**
|
||||
* Used to match ES template delimiters.
|
||||
* See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components)
|
||||
@@ -10073,7 +10080,7 @@
|
||||
*/
|
||||
function deburr(string) {
|
||||
string = baseToString(string);
|
||||
return string && string.replace(reLatin1, deburrLetter);
|
||||
return string && string.replace(reLatin1, deburrLetter).replace(reComboMarks, '');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user