mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: enhanced markdown editor
This commit is contained in:
1 parent
08f66e85bc
commit
de3d78b9bd
5 files changed
+100
-12
No files matched your search
@@ -92,8 +92,66 @@ const qqEmojies = [
|
||||
'quantou',
|
||||
'chajin',
|
||||
'aini',
|
||||
'no',
|
||||
'ok',
|
||||
'NO',
|
||||
'OK',
|
||||
'aiqing',
|
||||
'feiwen',
|
||||
'tiaotiao',
|
||||
'fadou',
|
||||
'ouhuo',
|
||||
'zhuanquan',
|
||||
'ketou',
|
||||
'huitou',
|
||||
'tiaosheng',
|
||||
'huishou',
|
||||
'jidong',
|
||||
'jiewu',
|
||||
'xianwen',
|
||||
'zuotaiji',
|
||||
'youtaiji',
|
||||
'shuangxi',
|
||||
'bianpao',
|
||||
'denglong',
|
||||
'facai',
|
||||
'Kge',
|
||||
'gouwu',
|
||||
'youjian',
|
||||
'shuai',
|
||||
'hecai',
|
||||
'qidao',
|
||||
'baojin',
|
||||
'bangbangtang',
|
||||
'henai',
|
||||
'xiamian',
|
||||
'xiangjiao',
|
||||
'feiji',
|
||||
'kaiche',
|
||||
'zuochetou',
|
||||
'chexiang',
|
||||
'youchetou',
|
||||
'duoyun',
|
||||
'xiayu',
|
||||
'chaopiao',
|
||||
'xiongmao',
|
||||
'dengpao',
|
||||
'fengche',
|
||||
'naozhong',
|
||||
'dasan',
|
||||
'caiqiu',
|
||||
'zuanjie',
|
||||
'shafa',
|
||||
'zhijin',
|
||||
'yao',
|
||||
'shouqiang',
|
||||
'qingwa',
|
||||
];
|
||||
const idMap = [
|
||||
14, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 50, 51, 96, 53, 54, 73, 74, 75, 76, 77, 78, 55, 56,
|
||||
57, 58, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
|
||||
109, 110, 111, 112, 32, 113, 114, 115, 63, 64, 59, 33, 34, 116, 36, 37, 38, 91, 92, 93, 29, 117, 72, 45,
|
||||
42, 39, 62, 46, 47, 71, 95, 118, 119, 120, 121, 122, 123, 124, 27, 21, 23, 25, 26, 125, 126, 127, 128,
|
||||
129, 130, 131, 132, 133, 134, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
|
||||
151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
|
||||
];
|
||||
|
||||
function emoji(range) {
|
||||
@@ -110,8 +168,8 @@ function qqEmoji(range) {
|
||||
return qqEmojies.map((i, index) => ({
|
||||
label: `/${i}`,
|
||||
kind: monaco.languages.CompletionItemKind.Keyword,
|
||||
documentation: ``,
|
||||
insertText: ` `,
|
||||
documentation: { value: ``, isTrusted: true },
|
||||
insertText: ` `,
|
||||
range,
|
||||
}));
|
||||
}
|
||||
@@ -181,9 +239,9 @@ monaco.languages.registerCompletionItemProvider('markdown', {
|
||||
`, ['data', 'users']);
|
||||
return {
|
||||
suggestions: users.map((i) => ({
|
||||
label: `@${i.uname} (UID=${i._id})`,
|
||||
label: { label: `@${i.uname}`, description: `UID=${i._id}` },
|
||||
kind: monaco.languages.CompletionItemKind.Property,
|
||||
documentation: { value: ``, isTrusted: true },
|
||||
documentation: { value: `[](#loader) `, isTrusted: true },
|
||||
insertText: `@[](/user/${i._id}) `,
|
||||
range,
|
||||
sortText: i.priv === 0 ? '0' : '1',
|
||||
|
||||
Reference in new issue
Block a user