summaryrefslogtreecommitdiff
path: root/patches/js-panmirror-no-pinyin.patch
blob: 3ad45ba64de8a53c9a6c4571b33f350f3d67e19e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
diff --git a/packages/editor/package.json b/packages/editor/package.json
index 65fc036b..2c1990af 100644
--- a/packages/editor/package.json
+++ b/packages/editor/package.json
@@ -20,7 +20,6 @@
     "lodash.orderby": "^4.6.0",
     "lodash.uniqby": "^4.7.0",
     "orderedmap": "^1.0.0",
-    "pinyin": "^2.10.2",
     "prosemirror-changeset": "^2.2.0",
     "prosemirror-commands": "^1.3.1",
     "prosemirror-dev-tools": "^3.1.0",
@@ -57,7 +56,6 @@
     "@types/lodash.orderby": "^4.6.6",
     "@types/lodash.uniqby": "^4.7.6",
     "@types/orderedmap": "^1.0.0",
-    "@types/pinyin": "^2.10.0",
     "@types/prosemirror-dev-tools": "^3.0.3",
     "@types/react": "^18.0.25",
     "@types/react-dom": "^18.0.8",
diff --git a/packages/editor/src/api/bibtex/language.ts b/packages/editor/src/api/bibtex/language.ts
index 0786dc4b..61e890e2 100644
--- a/packages/editor/src/api/bibtex/language.ts
+++ b/packages/editor/src/api/bibtex/language.ts
@@ -41,10 +41,6 @@ export const lanagugeMappings = {
     csl: 'ca-AD',
     bibtex: 'catalan',
   },
-  chinese: {
-    csl: 'zh-CN',
-    bibtex: 'pinyin',
-  },
   croatian: {
     csl: 'hr-HR',
     bibtex: 'croatian',
diff --git a/packages/editor/src/api/cite.ts b/packages/editor/src/api/cite.ts
index 9273d2c2..9a71b217 100644
--- a/packages/editor/src/api/cite.ts
+++ b/packages/editor/src/api/cite.ts
@@ -19,7 +19,6 @@ import { CSLName, CSLDate, CSL } from './csl';
 import { InsertCiteProps, InsertCiteUI } from 'editor-types';
 import { urlForDOI } from './doi';
 
-import pinyin from 'pinyin';
 import { transliterate } from 'transliteration';
 
 export type { CiteField };
@@ -42,8 +41,6 @@ export function createUniqueCiteId(existingIds: string[], baseId: string): strin
     const char = baseId.charCodeAt(i);
     if (char <= 255) {
       asciiOnlyBaseId = asciiOnlyBaseId + String.fromCharCode(char);
-    } else if (isHanzi(char)) {
-      asciiOnlyBaseId = asciiOnlyBaseId + pinyin(String.fromCharCode(char));
     } else {
       // Transliterate other non ascii characters to the citekey
       asciiOnlyBaseId = asciiOnlyBaseId + transliterate(String.fromCharCode(char));