Skip to content

Commit

Permalink
Merge pull request #1 from Casheeew/shiki-tm/master
Browse files Browse the repository at this point in the history
escape quotes
  • Loading branch information
shiki-tm authored Oct 13, 2024
2 parents 44a4f83 + f3e21b2 commit 061a86d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/js/language/zh/chinese.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ export function isCodePointChinese(codePoint) {

/** @type {import('language').ReadingNormalizer} */
export function normalizePinyin(str) {
return str.normalize('NFC').toLowerCase().replace(/(?<=\w)'(?=\w)/g, "\\'");
return str.normalize('NFC').toLowerCase().replace(/[\s:'-]|\/\//g, '');
}
2 changes: 1 addition & 1 deletion test/language/chinese-reading-normalizer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const tests = [
['fān・yì', 'fānyì'],
['fān//yì', 'fānyì'],
['fān’yì', 'fānyì'],
['fān'', 'fānyì'],
['fān\'yì', 'fānyì'],
['fān-yì', 'fānyì'],
];

Expand Down

0 comments on commit 061a86d

Please sign in to comment.