southnote-mini-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app.js +22 -0
- package/app.json +53 -0
- package/app.wxss +15 -0
- package/assets/file/badwords.js +63008 -0
- package/assets/file/rules.js +38 -0
- package/assets/images/emoji/smile001.png +0 -0
- package/assets/images/emoji/smile002.png +0 -0
- package/assets/images/emoji/smile003.png +0 -0
- package/assets/images/emoji/smile004.png +0 -0
- package/assets/images/emoji/smile005.png +0 -0
- package/assets/images/emoji/smile006.png +0 -0
- package/assets/images/emoji/smile007.png +0 -0
- package/assets/images/emoji/smile008.png +0 -0
- package/assets/images/emoji/smile009.png +0 -0
- package/assets/images/emoji/smile010.png +0 -0
- package/assets/images/emoji/smile011.png +0 -0
- package/assets/images/emoji/smile012.png +0 -0
- package/assets/images/emoji/smile013.png +0 -0
- package/assets/images/emoji/smile014.png +0 -0
- package/assets/images/emoji/smile015.png +0 -0
- package/assets/images/emoji/smile016.png +0 -0
- package/assets/images/emoji/smile017.png +0 -0
- package/assets/images/emoji/smile018.png +0 -0
- package/assets/images/emoji/smile019.png +0 -0
- package/assets/images/emoji/smile020.png +0 -0
- package/assets/images/emoji/smile021.png +0 -0
- package/assets/images/emoji/smile022.png +0 -0
- package/assets/images/emoji/smile023.png +0 -0
- package/assets/images/emoji/smile024.png +0 -0
- package/assets/images/emoji/smile025.png +0 -0
- package/assets/images/emoji/smile026.png +0 -0
- package/assets/images/emoji/smile027.png +0 -0
- package/assets/images/emoji/smile028.png +0 -0
- package/assets/images/emoji/smile029.png +0 -0
- package/assets/images/emoji/smile030.png +0 -0
- package/assets/images/emoji/smile031.png +0 -0
- package/assets/images/emoji/smile032.png +0 -0
- package/assets/images/emoji/smile033.png +0 -0
- package/assets/images/emoji/smile034.png +0 -0
- package/assets/images/emoji/smile035.png +0 -0
- package/assets/images/emoji/smile036.png +0 -0
- package/assets/images/emoji/smile037.png +0 -0
- package/assets/images/emoji/smile038.png +0 -0
- package/assets/images/emoji/smile039.png +0 -0
- package/assets/images/emoji/smile040.png +0 -0
- package/assets/images/emoji/smile041.png +0 -0
- package/assets/images/emoji/smile042.png +0 -0
- package/assets/images/emoji/smile043.png +0 -0
- package/assets/images/emoji/smile044.png +0 -0
- package/assets/images/emoji/smile045.png +0 -0
- package/assets/images/emoji/smile046.png +0 -0
- package/assets/images/emoji/smile047.png +0 -0
- package/assets/images/emoji/smile048.png +0 -0
- package/assets/images/emoji/smile049.png +0 -0
- package/assets/images/emoji/smile050.png +0 -0
- package/assets/images/emoji/smile051.png +0 -0
- package/assets/images/emoji/smile052.png +0 -0
- package/assets/images/icons/age1.png +0 -0
- package/assets/images/icons/age2.png +0 -0
- package/assets/images/icons/age3.png +0 -0
- package/assets/images/icons/attachment.png +0 -0
- package/assets/images/icons/clear.png +0 -0
- package/assets/images/icons/edit_input.png +0 -0
- package/assets/images/icons/header_placeholder.png +0 -0
- package/assets/images/icons/home_collect.png +0 -0
- package/assets/images/icons/home_collected.png +0 -0
- package/assets/images/icons/home_comment.png +0 -0
- package/assets/images/icons/home_like.png +0 -0
- package/assets/images/icons/home_liked.png +0 -0
- package/assets/images/icons/home_message.png +0 -0
- package/assets/images/icons/home_share.png +0 -0
- package/assets/images/icons/icon_more.png +0 -0
- package/assets/images/icons/input_game.png +0 -0
- package/assets/images/icons/logo.png +0 -0
- package/assets/images/icons/lv1.png +0 -0
- package/assets/images/icons/lv2.png +0 -0
- package/assets/images/icons/lv3.png +0 -0
- package/assets/images/icons/lv4.png +0 -0
- package/assets/images/icons/search.png +0 -0
- package/assets/images/icons/sex1.png +0 -0
- package/assets/images/icons/sex2.png +0 -0
- package/assets/images/icons/sign_empty.png +0 -0
- package/assets/images/icons/sign_login.png +0 -0
- package/assets/wheel/wheel_bg.png +0 -0
- package/assets/wheel/wheel_bg2.png +0 -0
- package/assets/wheel/wheel_fore.png +0 -0
- package/assets/wheel/wheel_to.png +0 -0
- package/components/bottomSheet/bottomSheet.js +473 -0
- package/components/bottomSheet/bottomSheet.json +3 -0
- package/components/bottomSheet/bottomSheet.wxml +73 -0
- package/components/bottomSheet/bottomSheet.wxss +238 -0
- package/components/experience-item/experience-item.js +105 -0
- package/components/experience-item/experience-item.json +4 -0
- package/components/experience-item/experience-item.wxml +39 -0
- package/components/experience-item/experience-item.wxss +110 -0
- package/components/grid-item/grid-item.js +8 -0
- package/components/grid-item/grid-item.json +4 -0
- package/components/grid-item/grid-item.wxml +62 -0
- package/components/grid-item/grid-item.wxss +191 -0
- package/components/post-item/post-item.js +1085 -0
- package/components/post-item/post-item.json +4 -0
- package/components/post-item/post-item.wxml +427 -0
- package/components/post-item/post-item.wxss +525 -0
- package/components/wiki-renderer/wiki-renderer.js +636 -0
- package/components/wiki-renderer/wiki-renderer.json +12 -0
- package/components/wiki-renderer/wiki-renderer.wxml +150 -0
- package/components/wiki-renderer/wiki-renderer.wxss +412 -0
- package/components/wiki-tabs/wiki-tabs.js +52 -0
- package/components/wiki-tabs/wiki-tabs.json +3 -0
- package/components/wiki-tabs/wiki-tabs.wxml +28 -0
- package/components/wiki-tabs/wiki-tabs.wxss +43 -0
- package/index.js +49 -0
- package/package.json +35 -0
- package/pages/addGame/addGame.js +454 -0
- package/pages/addGame/addGame.json +3 -0
- package/pages/addGame/addGame.wxml +71 -0
- package/pages/addGame/addGame.wxss +110 -0
- package/pages/addSubject/addSubject.js +199 -0
- package/pages/addSubject/addSubject.json +4 -0
- package/pages/addSubject/addSubject.wxml +78 -0
- package/pages/addSubject/addSubject.wxss +85 -0
- package/pages/commonLogin/commonLogin.js +269 -0
- package/pages/commonLogin/commonLogin.json +4 -0
- package/pages/commonLogin/commonLogin.wxml +57 -0
- package/pages/commonLogin/commonLogin.wxss +177 -0
- package/pages/copyOfficial/copyOfficial.js +25 -0
- package/pages/copyOfficial/copyOfficial.json +3 -0
- package/pages/copyOfficial/copyOfficial.wxml +22 -0
- package/pages/copyOfficial/copyOfficial.wxss +49 -0
- package/pages/demo/demo.js +23 -0
- package/pages/demo/demo.json +3 -0
- package/pages/demo/demo.wxml +8 -0
- package/pages/demo/demo.wxss +24 -0
- package/pages/game/game.js +1254 -0
- package/pages/game/game.json +8 -0
- package/pages/game/game.wxml +371 -0
- package/pages/game/game.wxss +672 -0
- package/pages/home/home.js +665 -0
- package/pages/home/home.json +10 -0
- package/pages/home/home.wxml +115 -0
- package/pages/home/home.wxss +231 -0
- package/pages/lottery-winners/lottery-winners.js +60 -0
- package/pages/lottery-winners/lottery-winners.json +4 -0
- package/pages/lottery-winners/lottery-winners.wxml +53 -0
- package/pages/lottery-winners/lottery-winners.wxss +127 -0
- package/pages/message/messageCommentsAndAt/messageCommentsAndAt.js +178 -0
- package/pages/message/messageCommentsAndAt/messageCommentsAndAt.json +5 -0
- package/pages/message/messageCommentsAndAt/messageCommentsAndAt.wxml +93 -0
- package/pages/message/messageCommentsAndAt/messageCommentsAndAt.wxss +177 -0
- package/pages/message/messageEntire/messageEntire.js +112 -0
- package/pages/message/messageEntire/messageEntire.json +4 -0
- package/pages/message/messageEntire/messageEntire.wxml +44 -0
- package/pages/message/messageEntire/messageEntire.wxss +88 -0
- package/pages/message/messageLikeAndCollect/messageLikeAndCollect.js +147 -0
- package/pages/message/messageLikeAndCollect/messageLikeAndCollect.json +5 -0
- package/pages/message/messageLikeAndCollect/messageLikeAndCollect.wxml +84 -0
- package/pages/message/messageLikeAndCollect/messageLikeAndCollect.wxss +166 -0
- package/pages/message/messageNewFans/messageNewFans.js +139 -0
- package/pages/message/messageNewFans/messageNewFans.json +5 -0
- package/pages/message/messageNewFans/messageNewFans.wxml +35 -0
- package/pages/message/messageNewFans/messageNewFans.wxss +85 -0
- package/pages/officialWebview/officialWebview.js +13 -0
- package/pages/officialWebview/officialWebview.json +3 -0
- package/pages/officialWebview/officialWebview.wxml +2 -0
- package/pages/officialWebview/officialWebview.wxss +1 -0
- package/pages/post/post.js +1856 -0
- package/pages/post/post.json +6 -0
- package/pages/post/post.wxml +694 -0
- package/pages/post/post.wxss +1003 -0
- package/pages/post-editor/post-editor.js +465 -0
- package/pages/post-editor/post-editor.json +4 -0
- package/pages/post-editor/post-editor.wxml +63 -0
- package/pages/post-editor/post-editor.wxss +195 -0
- package/pages/postDialog/postDialog.js +560 -0
- package/pages/postDialog/postDialog.json +6 -0
- package/pages/postDialog/postDialog.wxml +377 -0
- package/pages/postDialog/postDialog.wxss +979 -0
- package/pages/report-category/report-category.js +29 -0
- package/pages/report-category/report-category.json +4 -0
- package/pages/report-category/report-category.wxml +14 -0
- package/pages/report-category/report-category.wxss +43 -0
- package/pages/report-form/report-form.js +65 -0
- package/pages/report-form/report-form.json +3 -0
- package/pages/report-form/report-form.wxml +11 -0
- package/pages/report-form/report-form.wxss +44 -0
- package/pages/sevenDaySignDetail/sevenDaySignDetail.js +273 -0
- package/pages/sevenDaySignDetail/sevenDaySignDetail.json +3 -0
- package/pages/sevenDaySignDetail/sevenDaySignDetail.wxml +82 -0
- package/pages/sevenDaySignDetail/sevenDaySignDetail.wxss +173 -0
- package/pages/topic/topic.js +266 -0
- package/pages/topic/topic.json +6 -0
- package/pages/topic/topic.wxml +77 -0
- package/pages/topic/topic.wxss +162 -0
- package/pages/user/user.js +939 -0
- package/pages/user/user.json +5 -0
- package/pages/user/user.wxml +179 -0
- package/pages/user/user.wxss +340 -0
- package/pages/userDatum/userDatum.js +24 -0
- package/pages/userDatum/userDatum.json +4 -0
- package/pages/userDatum/userDatum.wxml +36 -0
- package/pages/userDatum/userDatum.wxss +41 -0
- package/pages/userGameLib/userGameLib.js +105 -0
- package/pages/userGameLib/userGameLib.json +4 -0
- package/pages/userGameLib/userGameLib.wxml +42 -0
- package/pages/userGameLib/userGameLib.wxss +119 -0
- package/pages/webview/webview.js +25 -0
- package/pages/webview/webview.json +3 -0
- package/pages/webview/webview.wxml +22 -0
- package/pages/webview/webview.wxss +50 -0
- package/pages/wheelActivivty/wheelActivivty.js +492 -0
- package/pages/wheelActivivty/wheelActivivty.json +8 -0
- package/pages/wheelActivivty/wheelActivivty.wxml +131 -0
- package/pages/wheelActivivty/wheelActivivty.wxss +459 -0
- package/pages/wiki/wiki.js +138 -0
- package/pages/wiki/wiki.json +6 -0
- package/pages/wiki/wiki.wxml +20 -0
- package/pages/wiki/wiki.wxss +44 -0
- package/request/JKRequest.js +177 -0
- package/services/home.js +603 -0
- package/towxml/config.js +291 -0
- package/towxml/decode.js +35 -0
- package/towxml/decode.json +11 -0
- package/towxml/decode.wxml +137 -0
- package/towxml/decode.wxss +0 -0
- package/towxml/img/img.js +98 -0
- package/towxml/img/img.json +3 -0
- package/towxml/img/img.wxml +1 -0
- package/towxml/img/img.wxss +0 -0
- package/towxml/index.js +19 -0
- package/towxml/latex/latex.js +53 -0
- package/towxml/latex/latex.json +5 -0
- package/towxml/latex/latex.wxml +1 -0
- package/towxml/latex/latex.wxss +0 -0
- package/towxml/parse/highlight/highlight.js +1 -0
- package/towxml/parse/highlight/index.js +8 -0
- package/towxml/parse/highlight/languages/bash.js +111 -0
- package/towxml/parse/highlight/languages/c-like.js +236 -0
- package/towxml/parse/highlight/languages/c.js +22 -0
- package/towxml/parse/highlight/languages/css.js +132 -0
- package/towxml/parse/highlight/languages/dart.js +134 -0
- package/towxml/parse/highlight/languages/go.js +63 -0
- package/towxml/parse/highlight/languages/htmlbars.js +80 -0
- package/towxml/parse/highlight/languages/java.js +125 -0
- package/towxml/parse/highlight/languages/javascript.js +265 -0
- package/towxml/parse/highlight/languages/json.js +52 -0
- package/towxml/parse/highlight/languages/less.js +148 -0
- package/towxml/parse/highlight/languages/nginx.js +101 -0
- package/towxml/parse/highlight/languages/php.js +161 -0
- package/towxml/parse/highlight/languages/python-repl.js +29 -0
- package/towxml/parse/highlight/languages/python.js +131 -0
- package/towxml/parse/highlight/languages/scss.js +122 -0
- package/towxml/parse/highlight/languages/shell.js +22 -0
- package/towxml/parse/highlight/languages/typescript.js +215 -0
- package/towxml/parse/highlight/languages/xml.js +139 -0
- package/towxml/parse/highlight/style/github.wxss +99 -0
- package/towxml/parse/highlight/style/monokai.wxss +70 -0
- package/towxml/parse/index.js +118 -0
- package/towxml/parse/markdown/index.js +67 -0
- package/towxml/parse/markdown/markdown.js +4 -0
- package/towxml/parse/markdown/plugins/echarts.js +11 -0
- package/towxml/parse/markdown/plugins/emoji.js +2 -0
- package/towxml/parse/markdown/plugins/ins.js +1 -0
- package/towxml/parse/markdown/plugins/latex.js +158 -0
- package/towxml/parse/markdown/plugins/mark.js +1 -0
- package/towxml/parse/markdown/plugins/sub.js +1 -0
- package/towxml/parse/markdown/plugins/sup.js +1 -0
- package/towxml/parse/markdown/plugins/todo.js +147 -0
- package/towxml/parse/markdown/plugins/yuml.js +20 -0
- package/towxml/parse/parse2/Parser.js +492 -0
- package/towxml/parse/parse2/Tokenizer.js +903 -0
- package/towxml/parse/parse2/domelementtype/index.js +55 -0
- package/towxml/parse/parse2/domhandler/index.js +145 -0
- package/towxml/parse/parse2/domhandler/node.js +474 -0
- package/towxml/parse/parse2/entities/decode.js +179 -0
- package/towxml/parse/parse2/entities/decode_codepoint.js +60 -0
- package/towxml/parse/parse2/entities/encode.js +77 -0
- package/towxml/parse/parse2/entities/escape.js +112 -0
- package/towxml/parse/parse2/entities/generated/decode-data-html.js +9 -0
- package/towxml/parse/parse2/entities/generated/decode-data-xml.js +9 -0
- package/towxml/parse/parse2/entities/generated/encode-html.js +12 -0
- package/towxml/parse/parse2/entities/index.js +137 -0
- package/towxml/parse/parse2/index.js +8 -0
- package/towxml/style/main.wxss +419 -0
- package/towxml/style/theme/dark.wxss +73 -0
- package/towxml/style/theme/light.wxss +63 -0
- package/towxml/table/table.js +11 -0
- package/towxml/table/table.json +6 -0
- package/towxml/table/table.wxml +24 -0
- package/towxml/table/table.wxss +0 -0
- package/towxml/todogroup/todogroup.js +20 -0
- package/towxml/todogroup/todogroup.json +6 -0
- package/towxml/todogroup/todogroup.wxml +12 -0
- package/towxml/todogroup/todogroup.wxss +3 -0
- package/towxml/towxml.js +22 -0
- package/towxml/towxml.json +6 -0
- package/towxml/towxml.wxml +5 -0
- package/towxml/towxml.wxss +8 -0
- package/towxml/yuml/yuml.js +51 -0
- package/towxml/yuml/yuml.json +5 -0
- package/towxml/yuml/yuml.wxml +5 -0
- package/towxml/yuml/yuml.wxss +0 -0
- package/utils/auth.js +17 -0
- package/utils/base64.js +67 -0
- package/utils/compressImage.js +41 -0
- package/utils/exp.js +49 -0
- package/utils/formatPost.js +18 -0
- package/utils/parseContent.js +191 -0
- package/utils/query-select.js +9 -0
- package/utils/sensitive.js +82 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Language: Go
|
|
3
|
+
Author: Stephan Kountso aka StepLg <steplg@gmail.com>
|
|
4
|
+
Contributors: Evgeny Stepanischev <imbolk@gmail.com>
|
|
5
|
+
Description: Google go language (golang). For info about language
|
|
6
|
+
Website: http://golang.org/
|
|
7
|
+
Category: common, system
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export default function(hljs) {
|
|
11
|
+
var GO_KEYWORDS = {
|
|
12
|
+
keyword:
|
|
13
|
+
'break default func interface select case map struct chan else goto package switch ' +
|
|
14
|
+
'const fallthrough if range type continue for import return var go defer ' +
|
|
15
|
+
'bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 ' +
|
|
16
|
+
'uint16 uint32 uint64 int uint uintptr rune',
|
|
17
|
+
literal:
|
|
18
|
+
'true false iota nil',
|
|
19
|
+
built_in:
|
|
20
|
+
'append cap close complex copy imag len make new panic print println real recover delete'
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
name: 'Go',
|
|
24
|
+
aliases: ['golang'],
|
|
25
|
+
keywords: GO_KEYWORDS,
|
|
26
|
+
illegal: '</',
|
|
27
|
+
contains: [
|
|
28
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
29
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
|
30
|
+
{
|
|
31
|
+
className: 'string',
|
|
32
|
+
variants: [
|
|
33
|
+
hljs.QUOTE_STRING_MODE,
|
|
34
|
+
hljs.APOS_STRING_MODE,
|
|
35
|
+
{begin: '`', end: '`'},
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
className: 'number',
|
|
40
|
+
variants: [
|
|
41
|
+
{begin: hljs.C_NUMBER_RE + '[i]', relevance: 1},
|
|
42
|
+
hljs.C_NUMBER_MODE
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
begin: /:=/ // relevance booster
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
className: 'function',
|
|
50
|
+
beginKeywords: 'func', end: '\\s*(\\{|$)', excludeEnd: true,
|
|
51
|
+
contains: [
|
|
52
|
+
hljs.TITLE_MODE,
|
|
53
|
+
{
|
|
54
|
+
className: 'params',
|
|
55
|
+
begin: /\(/, end: /\)/,
|
|
56
|
+
keywords: GO_KEYWORDS,
|
|
57
|
+
illegal: /["']/
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Language: HTMLBars
|
|
3
|
+
Requires: xml.js
|
|
4
|
+
Author: Michael Johnston <lastobelus@gmail.com>
|
|
5
|
+
Description: Matcher for HTMLBars
|
|
6
|
+
Website: https://github.com/tildeio/htmlbars
|
|
7
|
+
Category: template
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export default function(hljs) {
|
|
11
|
+
var BUILT_INS = 'action collection component concat debugger each each-in else get hash if input link-to loc log mut outlet partial query-params render textarea unbound unless with yield view';
|
|
12
|
+
|
|
13
|
+
var ATTR_ASSIGNMENT = {
|
|
14
|
+
illegal: /\}\}/,
|
|
15
|
+
begin: /[a-zA-Z0-9_]+=/,
|
|
16
|
+
returnBegin: true,
|
|
17
|
+
relevance: 0,
|
|
18
|
+
contains: [
|
|
19
|
+
{
|
|
20
|
+
className: 'attr', begin: /[a-zA-Z0-9_]+/
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var SUB_EXPR = {
|
|
26
|
+
illegal: /\}\}/,
|
|
27
|
+
begin: /\)/, end: /\)/,
|
|
28
|
+
contains: [
|
|
29
|
+
{
|
|
30
|
+
begin: /[a-zA-Z\.\-]+/,
|
|
31
|
+
keywords: {built_in: BUILT_INS},
|
|
32
|
+
starts: {
|
|
33
|
+
endsWithParent: true, relevance: 0,
|
|
34
|
+
contains: [
|
|
35
|
+
hljs.QUOTE_STRING_MODE,
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var TAG_INNARDS = {
|
|
43
|
+
endsWithParent: true, relevance: 0,
|
|
44
|
+
keywords: {keyword: 'as', built_in: BUILT_INS},
|
|
45
|
+
contains: [
|
|
46
|
+
hljs.QUOTE_STRING_MODE,
|
|
47
|
+
ATTR_ASSIGNMENT,
|
|
48
|
+
hljs.NUMBER_MODE
|
|
49
|
+
]
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
name: 'HTMLBars',
|
|
54
|
+
case_insensitive: true,
|
|
55
|
+
subLanguage: 'xml',
|
|
56
|
+
contains: [
|
|
57
|
+
hljs.COMMENT('{{!(--)?', '(--)?}}'),
|
|
58
|
+
{
|
|
59
|
+
className: 'template-tag',
|
|
60
|
+
begin: /\{\{[#\/]/, end: /\}\}/,
|
|
61
|
+
contains: [
|
|
62
|
+
{
|
|
63
|
+
className: 'name',
|
|
64
|
+
begin: /[a-zA-Z\.\-]+/,
|
|
65
|
+
keywords: {'builtin-name': BUILT_INS},
|
|
66
|
+
starts: TAG_INNARDS
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
className: 'template-variable',
|
|
72
|
+
begin: /\{\{[a-zA-Z][a-zA-Z\-]+/, end: /\}\}/,
|
|
73
|
+
keywords: {keyword: 'as', built_in: BUILT_INS},
|
|
74
|
+
contains: [
|
|
75
|
+
hljs.QUOTE_STRING_MODE
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Language: Java
|
|
3
|
+
Author: Vsevolod Solovyov <vsevolod.solovyov@gmail.com>
|
|
4
|
+
Category: common, enterprise
|
|
5
|
+
Website: https://www.java.com/
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export default function(hljs) {
|
|
9
|
+
var JAVA_IDENT_RE = '[\u00C0-\u02B8a-zA-Z_$][\u00C0-\u02B8a-zA-Z_$0-9]*';
|
|
10
|
+
var GENERIC_IDENT_RE = JAVA_IDENT_RE + '(<' + JAVA_IDENT_RE + '(\\s*,\\s*' + JAVA_IDENT_RE + ')*>)?';
|
|
11
|
+
var KEYWORDS =
|
|
12
|
+
'false synchronized int abstract float private char boolean var static null if const ' +
|
|
13
|
+
'for true while long strictfp finally protected import native final void ' +
|
|
14
|
+
'enum else break transient catch instanceof byte super volatile case assert short ' +
|
|
15
|
+
'package default double public try this switch continue throws protected public private ' +
|
|
16
|
+
'module requires exports do';
|
|
17
|
+
|
|
18
|
+
var ANNOTATION = {
|
|
19
|
+
className: 'meta',
|
|
20
|
+
begin: '@' + JAVA_IDENT_RE,
|
|
21
|
+
contains:[
|
|
22
|
+
{
|
|
23
|
+
begin: /\(/,
|
|
24
|
+
end: /\)/,
|
|
25
|
+
contains: ["self"] // allow nested () inside our annotation
|
|
26
|
+
},
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
// https://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html
|
|
30
|
+
var JAVA_NUMBER_RE = '\\b' +
|
|
31
|
+
'(' +
|
|
32
|
+
'0[bB]([01]+[01_]+[01]+|[01]+)' + // 0b...
|
|
33
|
+
'|' +
|
|
34
|
+
'0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)' + // 0x...
|
|
35
|
+
'|' +
|
|
36
|
+
'(' +
|
|
37
|
+
'([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?' +
|
|
38
|
+
'|' +
|
|
39
|
+
'\\.([\\d]+[\\d_]+[\\d]+|[\\d]+)' +
|
|
40
|
+
')' +
|
|
41
|
+
'([eE][-+]?\\d+)?' + // octal, decimal, float
|
|
42
|
+
')' +
|
|
43
|
+
'[lLfF]?';
|
|
44
|
+
var JAVA_NUMBER_MODE = {
|
|
45
|
+
className: 'number',
|
|
46
|
+
begin: JAVA_NUMBER_RE,
|
|
47
|
+
relevance: 0
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
name: 'Java',
|
|
52
|
+
aliases: ['jsp'],
|
|
53
|
+
keywords: KEYWORDS,
|
|
54
|
+
illegal: /<\/|#/,
|
|
55
|
+
contains: [
|
|
56
|
+
hljs.COMMENT(
|
|
57
|
+
'/\\*\\*',
|
|
58
|
+
'\\*/',
|
|
59
|
+
{
|
|
60
|
+
relevance : 0,
|
|
61
|
+
contains : [
|
|
62
|
+
{
|
|
63
|
+
// eat up @'s in emails to prevent them to be recognized as doctags
|
|
64
|
+
begin: /\w+@/, relevance: 0
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
className : 'doctag',
|
|
68
|
+
begin : '@[A-Za-z]+'
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
74
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
|
75
|
+
hljs.APOS_STRING_MODE,
|
|
76
|
+
hljs.QUOTE_STRING_MODE,
|
|
77
|
+
{
|
|
78
|
+
className: 'class',
|
|
79
|
+
beginKeywords: 'class interface', end: /[{;=]/, excludeEnd: true,
|
|
80
|
+
keywords: 'class interface',
|
|
81
|
+
illegal: /[:"\[\]]/,
|
|
82
|
+
contains: [
|
|
83
|
+
{beginKeywords: 'extends implements'},
|
|
84
|
+
hljs.UNDERSCORE_TITLE_MODE
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
// Expression keywords prevent 'keyword Name(...)' from being
|
|
89
|
+
// recognized as a function definition
|
|
90
|
+
beginKeywords: 'new throw return else',
|
|
91
|
+
relevance: 0
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
className: 'function',
|
|
95
|
+
begin: '(' + GENERIC_IDENT_RE + '\\s+)+' + hljs.UNDERSCORE_IDENT_RE + '\\s*\\(', returnBegin: true, end: /[{;=]/,
|
|
96
|
+
excludeEnd: true,
|
|
97
|
+
keywords: KEYWORDS,
|
|
98
|
+
contains: [
|
|
99
|
+
{
|
|
100
|
+
begin: hljs.UNDERSCORE_IDENT_RE + '\\s*\\(', returnBegin: true,
|
|
101
|
+
relevance: 0,
|
|
102
|
+
contains: [hljs.UNDERSCORE_TITLE_MODE]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
className: 'params',
|
|
106
|
+
begin: /\(/, end: /\)/,
|
|
107
|
+
keywords: KEYWORDS,
|
|
108
|
+
relevance: 0,
|
|
109
|
+
contains: [
|
|
110
|
+
ANNOTATION,
|
|
111
|
+
hljs.APOS_STRING_MODE,
|
|
112
|
+
hljs.QUOTE_STRING_MODE,
|
|
113
|
+
hljs.C_NUMBER_MODE,
|
|
114
|
+
hljs.C_BLOCK_COMMENT_MODE
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
118
|
+
hljs.C_BLOCK_COMMENT_MODE
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
JAVA_NUMBER_MODE,
|
|
122
|
+
ANNOTATION
|
|
123
|
+
]
|
|
124
|
+
};
|
|
125
|
+
}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Language: JavaScript
|
|
3
|
+
Description: JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions.
|
|
4
|
+
Category: common, scripting
|
|
5
|
+
Website: https://developer.mozilla.org/en-US/docs/Web/JavaScript
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export default function(hljs) {
|
|
9
|
+
var FRAGMENT = {
|
|
10
|
+
begin: '<>',
|
|
11
|
+
end: '</>'
|
|
12
|
+
};
|
|
13
|
+
var XML_TAG = {
|
|
14
|
+
begin: /<[A-Za-z0-9\\._:-]+/,
|
|
15
|
+
end: /\/[A-Za-z0-9\\._:-]+>|\/>/
|
|
16
|
+
};
|
|
17
|
+
var IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
|
|
18
|
+
var KEYWORDS = {
|
|
19
|
+
keyword:
|
|
20
|
+
'in of if for while finally var new function do return void else break catch ' +
|
|
21
|
+
'instanceof with throw case default try this switch continue typeof delete ' +
|
|
22
|
+
'let yield const export super debugger as async await static ' +
|
|
23
|
+
// ECMAScript 6 modules import
|
|
24
|
+
'import from as'
|
|
25
|
+
,
|
|
26
|
+
literal:
|
|
27
|
+
'true false null undefined NaN Infinity',
|
|
28
|
+
built_in:
|
|
29
|
+
'eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent ' +
|
|
30
|
+
'encodeURI encodeURIComponent escape unescape Object Function Boolean Error ' +
|
|
31
|
+
'EvalError InternalError RangeError ReferenceError StopIteration SyntaxError ' +
|
|
32
|
+
'TypeError URIError Number Math Date String RegExp Array Float32Array ' +
|
|
33
|
+
'Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array ' +
|
|
34
|
+
'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' +
|
|
35
|
+
'module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect ' +
|
|
36
|
+
'Promise'
|
|
37
|
+
};
|
|
38
|
+
var NUMBER = {
|
|
39
|
+
className: 'number',
|
|
40
|
+
variants: [
|
|
41
|
+
{ begin: '\\b(0[bB][01]+)n?' },
|
|
42
|
+
{ begin: '\\b(0[oO][0-7]+)n?' },
|
|
43
|
+
{ begin: hljs.C_NUMBER_RE + 'n?' }
|
|
44
|
+
],
|
|
45
|
+
relevance: 0
|
|
46
|
+
};
|
|
47
|
+
var SUBST = {
|
|
48
|
+
className: 'subst',
|
|
49
|
+
begin: '\\$\\{', end: '\\}',
|
|
50
|
+
keywords: KEYWORDS,
|
|
51
|
+
contains: [] // defined later
|
|
52
|
+
};
|
|
53
|
+
var HTML_TEMPLATE = {
|
|
54
|
+
begin: 'html`', end: '',
|
|
55
|
+
starts: {
|
|
56
|
+
end: '`', returnEnd: false,
|
|
57
|
+
contains: [
|
|
58
|
+
hljs.BACKSLASH_ESCAPE,
|
|
59
|
+
SUBST
|
|
60
|
+
],
|
|
61
|
+
subLanguage: 'xml',
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var CSS_TEMPLATE = {
|
|
65
|
+
begin: 'css`', end: '',
|
|
66
|
+
starts: {
|
|
67
|
+
end: '`', returnEnd: false,
|
|
68
|
+
contains: [
|
|
69
|
+
hljs.BACKSLASH_ESCAPE,
|
|
70
|
+
SUBST
|
|
71
|
+
],
|
|
72
|
+
subLanguage: 'css',
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
var TEMPLATE_STRING = {
|
|
76
|
+
className: 'string',
|
|
77
|
+
begin: '`', end: '`',
|
|
78
|
+
contains: [
|
|
79
|
+
hljs.BACKSLASH_ESCAPE,
|
|
80
|
+
SUBST
|
|
81
|
+
]
|
|
82
|
+
};
|
|
83
|
+
SUBST.contains = [
|
|
84
|
+
hljs.APOS_STRING_MODE,
|
|
85
|
+
hljs.QUOTE_STRING_MODE,
|
|
86
|
+
HTML_TEMPLATE,
|
|
87
|
+
CSS_TEMPLATE,
|
|
88
|
+
TEMPLATE_STRING,
|
|
89
|
+
NUMBER,
|
|
90
|
+
hljs.REGEXP_MODE
|
|
91
|
+
];
|
|
92
|
+
var PARAMS_CONTAINS = SUBST.contains.concat([
|
|
93
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
|
94
|
+
hljs.C_LINE_COMMENT_MODE
|
|
95
|
+
]);
|
|
96
|
+
var PARAMS = {
|
|
97
|
+
className: 'params',
|
|
98
|
+
begin: /\(/, end: /\)/,
|
|
99
|
+
excludeBegin: true,
|
|
100
|
+
excludeEnd: true,
|
|
101
|
+
contains: PARAMS_CONTAINS
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
return {
|
|
105
|
+
name: 'JavaScript',
|
|
106
|
+
aliases: ['js', 'jsx', 'mjs', 'cjs'],
|
|
107
|
+
keywords: KEYWORDS,
|
|
108
|
+
contains: [
|
|
109
|
+
{
|
|
110
|
+
className: 'meta',
|
|
111
|
+
relevance: 10,
|
|
112
|
+
begin: /^\s*['"]use (strict|asm)['"]/
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
className: 'meta',
|
|
116
|
+
begin: /^#!/, end: /$/
|
|
117
|
+
},
|
|
118
|
+
hljs.APOS_STRING_MODE,
|
|
119
|
+
hljs.QUOTE_STRING_MODE,
|
|
120
|
+
HTML_TEMPLATE,
|
|
121
|
+
CSS_TEMPLATE,
|
|
122
|
+
TEMPLATE_STRING,
|
|
123
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
124
|
+
hljs.COMMENT(
|
|
125
|
+
'/\\*\\*',
|
|
126
|
+
'\\*/',
|
|
127
|
+
{
|
|
128
|
+
relevance : 0,
|
|
129
|
+
contains : [
|
|
130
|
+
{
|
|
131
|
+
className : 'doctag',
|
|
132
|
+
begin : '@[A-Za-z]+',
|
|
133
|
+
contains : [
|
|
134
|
+
{
|
|
135
|
+
className: 'type',
|
|
136
|
+
begin: '\\{',
|
|
137
|
+
end: '\\}',
|
|
138
|
+
relevance: 0
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
className: 'variable',
|
|
142
|
+
begin: IDENT_RE + '(?=\\s*(-)|$)',
|
|
143
|
+
endsParent: true,
|
|
144
|
+
relevance: 0
|
|
145
|
+
},
|
|
146
|
+
// eat spaces (not newlines) so we can find
|
|
147
|
+
// types or variables
|
|
148
|
+
{
|
|
149
|
+
begin: /(?=[^\n])\s/,
|
|
150
|
+
relevance: 0
|
|
151
|
+
},
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
|
158
|
+
NUMBER,
|
|
159
|
+
{ // object attr container
|
|
160
|
+
begin: /[{,\n]\s*/, relevance: 0,
|
|
161
|
+
contains: [
|
|
162
|
+
{
|
|
163
|
+
begin: IDENT_RE + '\\s*:', returnBegin: true,
|
|
164
|
+
relevance: 0,
|
|
165
|
+
contains: [{className: 'attr', begin: IDENT_RE, relevance: 0}]
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
{ // "value" container
|
|
170
|
+
begin: '(' + hljs.RE_STARTERS_RE + '|\\b(case|return|throw)\\b)\\s*',
|
|
171
|
+
keywords: 'return throw case',
|
|
172
|
+
contains: [
|
|
173
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
174
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
|
175
|
+
hljs.REGEXP_MODE,
|
|
176
|
+
{
|
|
177
|
+
className: 'function',
|
|
178
|
+
begin: '(\\(.*?\\)|' + IDENT_RE + ')\\s*=>', returnBegin: true,
|
|
179
|
+
end: '\\s*=>',
|
|
180
|
+
contains: [
|
|
181
|
+
{
|
|
182
|
+
className: 'params',
|
|
183
|
+
variants: [
|
|
184
|
+
{
|
|
185
|
+
begin: IDENT_RE
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
begin: /\(\s*\)/,
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
begin: /\(/, end: /\)/,
|
|
192
|
+
excludeBegin: true, excludeEnd: true,
|
|
193
|
+
keywords: KEYWORDS,
|
|
194
|
+
contains: PARAMS_CONTAINS
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
{ // could be a comma delimited list of params to a function call
|
|
201
|
+
begin: /,/, relevance: 0,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
className: '',
|
|
205
|
+
begin: /\s/,
|
|
206
|
+
end: /\s*/,
|
|
207
|
+
skip: true,
|
|
208
|
+
},
|
|
209
|
+
{ // JSX
|
|
210
|
+
variants: [
|
|
211
|
+
{ begin: FRAGMENT.begin, end: FRAGMENT.end },
|
|
212
|
+
{ begin: XML_TAG.begin, end: XML_TAG.end }
|
|
213
|
+
],
|
|
214
|
+
subLanguage: 'xml',
|
|
215
|
+
contains: [
|
|
216
|
+
{
|
|
217
|
+
begin: XML_TAG.begin, end: XML_TAG.end, skip: true,
|
|
218
|
+
contains: ['self']
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
relevance: 0
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
className: 'function',
|
|
227
|
+
beginKeywords: 'function', end: /\{/, excludeEnd: true,
|
|
228
|
+
contains: [
|
|
229
|
+
hljs.inherit(hljs.TITLE_MODE, {begin: IDENT_RE}),
|
|
230
|
+
PARAMS
|
|
231
|
+
],
|
|
232
|
+
illegal: /\[|%/
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
begin: /\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
hljs.METHOD_GUARD,
|
|
239
|
+
{ // ES6 class
|
|
240
|
+
className: 'class',
|
|
241
|
+
beginKeywords: 'class', end: /[{;=]/, excludeEnd: true,
|
|
242
|
+
illegal: /[:"\[\]]/,
|
|
243
|
+
contains: [
|
|
244
|
+
{beginKeywords: 'extends'},
|
|
245
|
+
hljs.UNDERSCORE_TITLE_MODE
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
beginKeywords: 'constructor', end: /\{/, excludeEnd: true
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
begin:'(get|set)\\s*(?=' + IDENT_RE+ '\\()',
|
|
253
|
+
end: /{/,
|
|
254
|
+
keywords: "get set",
|
|
255
|
+
contains: [
|
|
256
|
+
hljs.inherit(hljs.TITLE_MODE, {begin: IDENT_RE}),
|
|
257
|
+
{ begin: /\(\)/ }, // eat to avoid empty params
|
|
258
|
+
PARAMS
|
|
259
|
+
]
|
|
260
|
+
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
illegal: /#(?!!)/
|
|
264
|
+
};
|
|
265
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Language: JSON
|
|
3
|
+
Description: JSON (JavaScript Object Notation) is a lightweight data-interchange format.
|
|
4
|
+
Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
|
|
5
|
+
Website: http://www.json.org
|
|
6
|
+
Category: common, protocols
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export default function(hljs) {
|
|
10
|
+
var LITERALS = {literal: 'true false null'};
|
|
11
|
+
var ALLOWED_COMMENTS = [
|
|
12
|
+
hljs.C_LINE_COMMENT_MODE,
|
|
13
|
+
hljs.C_BLOCK_COMMENT_MODE
|
|
14
|
+
]
|
|
15
|
+
var TYPES = [
|
|
16
|
+
hljs.QUOTE_STRING_MODE,
|
|
17
|
+
hljs.C_NUMBER_MODE
|
|
18
|
+
];
|
|
19
|
+
var VALUE_CONTAINER = {
|
|
20
|
+
end: ',', endsWithParent: true, excludeEnd: true,
|
|
21
|
+
contains: TYPES,
|
|
22
|
+
keywords: LITERALS
|
|
23
|
+
};
|
|
24
|
+
var OBJECT = {
|
|
25
|
+
begin: '{', end: '}',
|
|
26
|
+
contains: [
|
|
27
|
+
{
|
|
28
|
+
className: 'attr',
|
|
29
|
+
begin: /"/, end: /"/,
|
|
30
|
+
contains: [hljs.BACKSLASH_ESCAPE],
|
|
31
|
+
illegal: '\\n',
|
|
32
|
+
},
|
|
33
|
+
hljs.inherit(VALUE_CONTAINER, {begin: /:/})
|
|
34
|
+
].concat(ALLOWED_COMMENTS),
|
|
35
|
+
illegal: '\\S'
|
|
36
|
+
};
|
|
37
|
+
var ARRAY = {
|
|
38
|
+
begin: '\\[', end: '\\]',
|
|
39
|
+
contains: [hljs.inherit(VALUE_CONTAINER)], // inherit is a workaround for a bug that makes shared modes with endsWithParent compile only the ending of one of the parents
|
|
40
|
+
illegal: '\\S'
|
|
41
|
+
};
|
|
42
|
+
TYPES.push(OBJECT, ARRAY);
|
|
43
|
+
ALLOWED_COMMENTS.forEach(function(rule) {
|
|
44
|
+
TYPES.push(rule)
|
|
45
|
+
})
|
|
46
|
+
return {
|
|
47
|
+
name: 'JSON',
|
|
48
|
+
contains: TYPES,
|
|
49
|
+
keywords: LITERALS,
|
|
50
|
+
illegal: '\\S'
|
|
51
|
+
};
|
|
52
|
+
}
|