node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

22
server/node_modules/markdown-it-emoji/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
Copyright (c) 2014 Vitaly Puzrin.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

102
server/node_modules/markdown-it-emoji/README.md generated vendored Normal file
View File

@@ -0,0 +1,102 @@
# markdown-it-emoji
[![Build Status](https://img.shields.io/travis/markdown-it/markdown-it-emoji/master.svg?style=flat)](https://travis-ci.org/markdown-it/markdown-it-emoji)
[![NPM version](https://img.shields.io/npm/v/markdown-it-emoji.svg?style=flat)](https://www.npmjs.org/package/markdown-it-emoji)
[![Coverage Status](https://coveralls.io/repos/markdown-it/markdown-it-emoji/badge.svg?branch=master&service=github)](https://coveralls.io/github/markdown-it/markdown-it-emoji?branch=master)
> Plugin for [markdown-it](https://github.com/markdown-it/markdown-it) markdown parser, adding emoji & emoticon syntax support.
__v1.+ requires `markdown-it` v4.+, see changelog.__
Three versions:
- __Full__ (default), with all github supported emojis.
- [Light](https://github.com/markdown-it/markdown-it-emoji/blob/master/lib/data/light.json), with only well-supported unicode emojis and reduced size.
- Bare, without included emojis or shortcuts. This requires defining your own definitions and shortcuts.
Also supports emoticons [shortcuts](https://github.com/markdown-it/markdown-it-emoji/blob/master/lib/data/shortcuts.js) like `:)`, `:-(`, and others. See the full list in the link above.
## Install
node.js, browser:
```bash
npm install markdown-it-emoji --save
bower install markdown-it-emoji --save
```
## Use
### init
```js
var md = require('markdown-it')();
var emoji = require('markdown-it-emoji');
// Or for light version
// var emoji = require('markdown-it-emoji/light');
md.use(emoji [, options]);
```
Options are not mandatory:
- __defs__ (Object) - rewrite available emoji definitions
- example: `{ name1: char1, name2: char2, ... }`
- __enabled__ (Array) - disable all emojis except whitelisted
- __shortcuts__ (Object) - rewrite default shortcuts
- example: `{ "smile": [ ":)", ":-)" ], "laughing": ":D" }`
_Differences in browser._ If you load the script directly into the page without
using a package system, the module will add itself globally with the name `markdownitEmoji`.
Init code will look a bit different in this case:
```js
var md = window.markdownit().use(window.markdownitEmoji);
```
### change output
By default, emojis are rendered as appropriate unicode chars. But you can change
the renderer function as you wish.
Render as span blocks (for example, to use a custom iconic font):
```js
// ...
// initialize
md.renderer.rules.emoji = function(token, idx) {
return '<span class="emoji emoji_' + token[idx].markup + '"></span>';
};
```
Or use [twemoji](https://github.com/twitter/twemoji):
```js
// ...
// initialize
var twemoji = require('twemoji')
md.renderer.rules.emoji = function(token, idx) {
return twemoji.parse(token[idx].content);
};
```
__NB 1__. Read [twemoji docs](https://github.com/twitter/twemoji#string-parsing)!
In case you need more options to change image size & type.
__NB 2__. When using twemoji you can make image height match the line height with this
style:
```css
.emoji {
height: 1.2em;
}
```
## License
[MIT](https://github.com/markdown-it/markdown-it-emoji/blob/master/LICENSE)

25
server/node_modules/markdown-it-emoji/bare.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
'use strict';
var emoji_html = require('./lib/render');
var emoji_replace = require('./lib/replace');
var normalize_opts = require('./lib/normalize_opts');
module.exports = function emoji_plugin(md, options) {
var defaults = {
defs: {},
shortcuts: {},
enabled: []
};
var opts = normalize_opts(md.utils.assign({}, defaults, options || {}));
md.renderer.rules.emoji = emoji_html;
md.core.ruler.after(
'linkify',
'emoji',
emoji_replace(md, opts.defs, opts.shortcuts, opts.scanRE, opts.replaceRE)
);
};

View File

@@ -0,0 +1,182 @@
/*! markdown-it-emoji 2.0.2 https://github.com/markdown-it/markdown-it-emoji @license MIT */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.markdownitEmoji = factory());
})(this, (function () { 'use strict';
var render = function emoji_html(tokens, idx /*, options, env */) {
return tokens[idx].content;
};
// Emojies & shortcuts replacement logic.
var replace = function create_rule(md, emojies, shortcuts, scanRE, replaceRE) {
var arrayReplaceAt = md.utils.arrayReplaceAt,
ucm = md.utils.lib.ucmicro,
ZPCc = new RegExp([ ucm.Z.source, ucm.P.source, ucm.Cc.source ].join('|'));
function splitTextToken(text, level, Token) {
var token, last_pos = 0, nodes = [];
text.replace(replaceRE, function (match, offset, src) {
var emoji_name;
// Validate emoji name
if (shortcuts.hasOwnProperty(match)) {
// replace shortcut with full name
emoji_name = shortcuts[match];
// Don't allow letters before any shortcut (as in no ":/" in http://)
if (offset > 0 && !ZPCc.test(src[offset - 1])) {
return;
}
// Don't allow letters after any shortcut
if (offset + match.length < src.length && !ZPCc.test(src[offset + match.length])) {
return;
}
} else {
emoji_name = match.slice(1, -1);
}
// Add new tokens to pending list
if (offset > last_pos) {
token = new Token('text', '', 0);
token.content = text.slice(last_pos, offset);
nodes.push(token);
}
token = new Token('emoji', '', 0);
token.markup = emoji_name;
token.content = emojies[emoji_name];
nodes.push(token);
last_pos = offset + match.length;
});
if (last_pos < text.length) {
token = new Token('text', '', 0);
token.content = text.slice(last_pos);
nodes.push(token);
}
return nodes;
}
return function emoji_replace(state) {
var i, j, l, tokens, token,
blockTokens = state.tokens,
autolinkLevel = 0;
for (j = 0, l = blockTokens.length; j < l; j++) {
if (blockTokens[j].type !== 'inline') { continue; }
tokens = blockTokens[j].children;
// We scan from the end, to keep position when new tags added.
// Use reversed logic in links start/end match
for (i = tokens.length - 1; i >= 0; i--) {
token = tokens[i];
if (token.type === 'link_open' || token.type === 'link_close') {
if (token.info === 'auto') { autolinkLevel -= token.nesting; }
}
if (token.type === 'text' && autolinkLevel === 0 && scanRE.test(token.content)) {
// replace current node
blockTokens[j].children = tokens = arrayReplaceAt(
tokens, i, splitTextToken(token.content, token.level, state.Token)
);
}
}
}
};
};
// Convert input options to more useable format
function quoteRE(str) {
return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&');
}
var normalize_opts = function normalize_opts(options) {
var emojies = options.defs,
shortcuts;
// Filter emojies by whitelist, if needed
if (options.enabled.length) {
emojies = Object.keys(emojies).reduce(function (acc, key) {
if (options.enabled.indexOf(key) >= 0) {
acc[key] = emojies[key];
}
return acc;
}, {});
}
// Flatten shortcuts to simple object: { alias: emoji_name }
shortcuts = Object.keys(options.shortcuts).reduce(function (acc, key) {
// Skip aliases for filtered emojies, to reduce regexp
if (!emojies[key]) { return acc; }
if (Array.isArray(options.shortcuts[key])) {
options.shortcuts[key].forEach(function (alias) {
acc[alias] = key;
});
return acc;
}
acc[options.shortcuts[key]] = key;
return acc;
}, {});
var keys = Object.keys(emojies),
names;
// If no definitions are given, return empty regex to avoid replacements with 'undefined'.
if (keys.length === 0) {
names = '^$';
} else {
// Compile regexp
names = keys
.map(function (name) { return ':' + name + ':'; })
.concat(Object.keys(shortcuts))
.sort()
.reverse()
.map(function (name) { return quoteRE(name); })
.join('|');
}
var scanRE = RegExp(names);
var replaceRE = RegExp(names, 'g');
return {
defs: emojies,
shortcuts: shortcuts,
scanRE: scanRE,
replaceRE: replaceRE
};
};
var bare = function emoji_plugin(md, options) {
var defaults = {
defs: {},
shortcuts: {},
enabled: []
};
var opts = normalize_opts(md.utils.assign({}, defaults, options || {}));
md.renderer.rules.emoji = render;
md.core.ruler.after(
'linkify',
'emoji',
replace(md, opts.defs, opts.shortcuts, opts.scanRE, opts.replaceRE)
);
};
return bare;
}));

View File

@@ -0,0 +1,2 @@
/*! markdown-it-emoji 2.0.2 https://github.com/markdown-it/markdown-it-emoji @license MIT */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).markdownitEmoji=t()}(this,(function(){"use strict";var e=function(e,t){return e[t].content};return function(t,n){var r=function(e){var t,n=e.defs;e.enabled.length&&(n=Object.keys(n).reduce((function(t,r){return e.enabled.indexOf(r)>=0&&(t[r]=n[r]),t}),{})),t=Object.keys(e.shortcuts).reduce((function(t,r){return n[r]?Array.isArray(e.shortcuts[r])?(e.shortcuts[r].forEach((function(e){t[e]=r})),t):(t[e.shortcuts[r]]=r,t):t}),{});var r,o=Object.keys(n);r=0===o.length?"^$":o.map((function(e){return":"+e+":"})).concat(Object.keys(t)).sort().reverse().map((function(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")})).join("|");var c=RegExp(r),s=RegExp(r,"g");return{defs:n,shortcuts:t,scanRE:c,replaceRE:s}}(t.utils.assign({},{defs:{},shortcuts:{},enabled:[]},n||{}));t.renderer.rules.emoji=e,t.core.ruler.after("linkify","emoji",function(e,t,n,r,o){var c=e.utils.arrayReplaceAt,s=e.utils.lib.ucmicro,i=new RegExp([s.Z.source,s.P.source,s.Cc.source].join("|"));function u(e,r,c){var s,u=0,l=[];return e.replace(o,(function(r,o,f){var a;if(n.hasOwnProperty(r)){if(a=n[r],o>0&&!i.test(f[o-1]))return;if(o+r.length<f.length&&!i.test(f[o+r.length]))return}else a=r.slice(1,-1);o>u&&((s=new c("text","",0)).content=e.slice(u,o),l.push(s)),(s=new c("emoji","",0)).markup=a,s.content=t[a],l.push(s),u=o+r.length})),u<e.length&&((s=new c("text","",0)).content=e.slice(u),l.push(s)),l}return function(e){var t,n,o,s,i,l=e.tokens,f=0;for(n=0,o=l.length;n<o;n++)if("inline"===l[n].type)for(t=(s=l[n].children).length-1;t>=0;t--)"link_open"!==(i=s[t]).type&&"link_close"!==i.type||"auto"===i.info&&(f-=i.nesting),"text"===i.type&&0===f&&r.test(i.content)&&(l[n].children=s=c(s,t,u(i.content,i.level,e.Token)))}}(t,r.defs,r.shortcuts,r.scanRE,r.replaceRE))}}));

View File

@@ -0,0 +1,378 @@
/*! markdown-it-emoji 2.0.2 https://github.com/markdown-it/markdown-it-emoji @license MIT */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.markdownitEmoji = factory());
})(this, (function () { 'use strict';
var emojies_defs = {
grinning: "😀",
smiley: "😃",
smile: "😄",
grin: "😁",
laughing: "😆",
satisfied: "😆",
sweat_smile: "😅",
joy: "😂",
wink: "😉",
blush: "😊",
innocent: "😇",
heart_eyes: "😍",
kissing_heart: "😘",
kissing: "😗",
kissing_closed_eyes: "😚",
kissing_smiling_eyes: "😙",
yum: "😋",
stuck_out_tongue: "😛",
stuck_out_tongue_winking_eye: "😜",
stuck_out_tongue_closed_eyes: "😝",
neutral_face: "😐",
expressionless: "😑",
no_mouth: "😶",
smirk: "😏",
unamused: "😒",
relieved: "😌",
pensive: "😔",
sleepy: "😪",
sleeping: "😴",
mask: "😷",
dizzy_face: "😵",
sunglasses: "😎",
confused: "😕",
worried: "😟",
open_mouth: "😮",
hushed: "😯",
astonished: "😲",
flushed: "😳",
frowning: "😦",
anguished: "😧",
fearful: "😨",
cold_sweat: "😰",
disappointed_relieved: "😥",
cry: "😢",
sob: "😭",
scream: "😱",
confounded: "😖",
persevere: "😣",
disappointed: "😞",
sweat: "😓",
weary: "😩",
tired_face: "😫",
rage: "😡",
pout: "😡",
angry: "😠",
smiling_imp: "😈",
smiley_cat: "😺",
smile_cat: "😸",
joy_cat: "😹",
heart_eyes_cat: "😻",
smirk_cat: "😼",
kissing_cat: "😽",
scream_cat: "🙀",
crying_cat_face: "😿",
pouting_cat: "😾",
heart: "❤️",
hand: "✋",
raised_hand: "✋",
v: "✌️",
point_up: "☝️",
fist_raised: "✊",
fist: "✊",
monkey_face: "🐵",
cat: "🐱",
cow: "🐮",
mouse: "🐭",
coffee: "☕",
hotsprings: "♨️",
anchor: "⚓",
airplane: "✈️",
hourglass: "⌛",
watch: "⌚",
sunny: "☀️",
star: "⭐",
cloud: "☁️",
umbrella: "☔",
zap: "⚡",
snowflake: "❄️",
sparkles: "✨",
black_joker: "🃏",
mahjong: "🀄",
phone: "☎️",
telephone: "☎️",
envelope: "✉️",
pencil2: "✏️",
black_nib: "✒️",
scissors: "✂️",
wheelchair: "♿",
warning: "⚠️",
aries: "♈",
taurus: "♉",
gemini: "♊",
cancer: "♋",
leo: "♌",
virgo: "♍",
libra: "♎",
scorpius: "♏",
sagittarius: "♐",
capricorn: "♑",
aquarius: "♒",
pisces: "♓",
heavy_multiplication_x: "✖️",
heavy_plus_sign: "",
heavy_minus_sign: "",
heavy_division_sign: "➗",
bangbang: "‼️",
interrobang: "⁉️",
question: "❓",
grey_question: "❔",
grey_exclamation: "❕",
exclamation: "❗",
heavy_exclamation_mark: "❗",
wavy_dash: "〰️",
recycle: "♻️",
white_check_mark: "✅",
ballot_box_with_check: "☑️",
heavy_check_mark: "✔️",
x: "❌",
negative_squared_cross_mark: "❎",
curly_loop: "➰",
loop: "➿",
part_alternation_mark: "〽️",
eight_spoked_asterisk: "✳️",
eight_pointed_black_star: "✴️",
sparkle: "❇️",
copyright: "©️",
registered: "®️",
tm: "™️",
information_source: "",
m: "Ⓜ️",
black_circle: "⚫",
white_circle: "⚪",
black_large_square: "⬛",
white_large_square: "⬜",
black_medium_square: "◼️",
white_medium_square: "◻️",
black_medium_small_square: "◾",
white_medium_small_square: "◽",
black_small_square: "▪️",
white_small_square: "▫️"
};
// Emoticons -> Emoji mapping.
var shortcuts = {
angry: [ '>:(', '>:-(' ],
blush: [ ':")', ':-")' ],
broken_heart: [ '</3', '<\\3' ],
// :\ and :-\ not used because of conflict with markdown escaping
confused: [ ':/', ':-/' ], // twemoji shows question
cry: [ ":'(", ":'-(", ':,(', ':,-(' ],
frowning: [ ':(', ':-(' ],
heart: [ '<3' ],
imp: [ ']:(', ']:-(' ],
innocent: [ 'o:)', 'O:)', 'o:-)', 'O:-)', '0:)', '0:-)' ],
joy: [ ":')", ":'-)", ':,)', ':,-)', ":'D", ":'-D", ':,D', ':,-D' ],
kissing: [ ':*', ':-*' ],
laughing: [ 'x-)', 'X-)' ],
neutral_face: [ ':|', ':-|' ],
open_mouth: [ ':o', ':-o', ':O', ':-O' ],
rage: [ ':@', ':-@' ],
smile: [ ':D', ':-D' ],
smiley: [ ':)', ':-)' ],
smiling_imp: [ ']:)', ']:-)' ],
sob: [ ":,'(", ":,'-(", ';(', ';-(' ],
stuck_out_tongue: [ ':P', ':-P' ],
sunglasses: [ '8-)', 'B-)' ],
sweat: [ ',:(', ',:-(' ],
sweat_smile: [ ',:)', ',:-)' ],
unamused: [ ':s', ':-S', ':z', ':-Z', ':$', ':-$' ],
wink: [ ';)', ';-)' ]
};
var render = function emoji_html(tokens, idx /*, options, env */) {
return tokens[idx].content;
};
// Emojies & shortcuts replacement logic.
var replace = function create_rule(md, emojies, shortcuts, scanRE, replaceRE) {
var arrayReplaceAt = md.utils.arrayReplaceAt,
ucm = md.utils.lib.ucmicro,
ZPCc = new RegExp([ ucm.Z.source, ucm.P.source, ucm.Cc.source ].join('|'));
function splitTextToken(text, level, Token) {
var token, last_pos = 0, nodes = [];
text.replace(replaceRE, function (match, offset, src) {
var emoji_name;
// Validate emoji name
if (shortcuts.hasOwnProperty(match)) {
// replace shortcut with full name
emoji_name = shortcuts[match];
// Don't allow letters before any shortcut (as in no ":/" in http://)
if (offset > 0 && !ZPCc.test(src[offset - 1])) {
return;
}
// Don't allow letters after any shortcut
if (offset + match.length < src.length && !ZPCc.test(src[offset + match.length])) {
return;
}
} else {
emoji_name = match.slice(1, -1);
}
// Add new tokens to pending list
if (offset > last_pos) {
token = new Token('text', '', 0);
token.content = text.slice(last_pos, offset);
nodes.push(token);
}
token = new Token('emoji', '', 0);
token.markup = emoji_name;
token.content = emojies[emoji_name];
nodes.push(token);
last_pos = offset + match.length;
});
if (last_pos < text.length) {
token = new Token('text', '', 0);
token.content = text.slice(last_pos);
nodes.push(token);
}
return nodes;
}
return function emoji_replace(state) {
var i, j, l, tokens, token,
blockTokens = state.tokens,
autolinkLevel = 0;
for (j = 0, l = blockTokens.length; j < l; j++) {
if (blockTokens[j].type !== 'inline') { continue; }
tokens = blockTokens[j].children;
// We scan from the end, to keep position when new tags added.
// Use reversed logic in links start/end match
for (i = tokens.length - 1; i >= 0; i--) {
token = tokens[i];
if (token.type === 'link_open' || token.type === 'link_close') {
if (token.info === 'auto') { autolinkLevel -= token.nesting; }
}
if (token.type === 'text' && autolinkLevel === 0 && scanRE.test(token.content)) {
// replace current node
blockTokens[j].children = tokens = arrayReplaceAt(
tokens, i, splitTextToken(token.content, token.level, state.Token)
);
}
}
}
};
};
// Convert input options to more useable format
function quoteRE(str) {
return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&');
}
var normalize_opts = function normalize_opts(options) {
var emojies = options.defs,
shortcuts;
// Filter emojies by whitelist, if needed
if (options.enabled.length) {
emojies = Object.keys(emojies).reduce(function (acc, key) {
if (options.enabled.indexOf(key) >= 0) {
acc[key] = emojies[key];
}
return acc;
}, {});
}
// Flatten shortcuts to simple object: { alias: emoji_name }
shortcuts = Object.keys(options.shortcuts).reduce(function (acc, key) {
// Skip aliases for filtered emojies, to reduce regexp
if (!emojies[key]) { return acc; }
if (Array.isArray(options.shortcuts[key])) {
options.shortcuts[key].forEach(function (alias) {
acc[alias] = key;
});
return acc;
}
acc[options.shortcuts[key]] = key;
return acc;
}, {});
var keys = Object.keys(emojies),
names;
// If no definitions are given, return empty regex to avoid replacements with 'undefined'.
if (keys.length === 0) {
names = '^$';
} else {
// Compile regexp
names = keys
.map(function (name) { return ':' + name + ':'; })
.concat(Object.keys(shortcuts))
.sort()
.reverse()
.map(function (name) { return quoteRE(name); })
.join('|');
}
var scanRE = RegExp(names);
var replaceRE = RegExp(names, 'g');
return {
defs: emojies,
shortcuts: shortcuts,
scanRE: scanRE,
replaceRE: replaceRE
};
};
var bare = function emoji_plugin(md, options) {
var defaults = {
defs: {},
shortcuts: {},
enabled: []
};
var opts = normalize_opts(md.utils.assign({}, defaults, options || {}));
md.renderer.rules.emoji = render;
md.core.ruler.after(
'linkify',
'emoji',
replace(md, opts.defs, opts.shortcuts, opts.scanRE, opts.replaceRE)
);
};
var light = function emoji_plugin(md, options) {
var defaults = {
defs: emojies_defs,
shortcuts: shortcuts,
enabled: []
};
var opts = md.utils.assign({}, defaults, options || {});
bare(md, opts);
};
return light;
}));

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

19
server/node_modules/markdown-it-emoji/index.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
'use strict';
var emojies_defs = require('./lib/data/full.json');
var emojies_shortcuts = require('./lib/data/shortcuts');
var bare_emoji_plugin = require('./bare');
module.exports = function emoji_plugin(md, options) {
var defaults = {
defs: emojies_defs,
shortcuts: emojies_shortcuts,
enabled: []
};
var opts = md.utils.assign({}, defaults, options || {});
bare_emoji_plugin(md, opts);
};

1840
server/node_modules/markdown-it-emoji/lib/data/full.json generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,152 @@
{
"grinning": "😀",
"smiley": "😃",
"smile": "😄",
"grin": "😁",
"laughing": "😆",
"satisfied": "😆",
"sweat_smile": "😅",
"joy": "😂",
"wink": "😉",
"blush": "😊",
"innocent": "😇",
"heart_eyes": "😍",
"kissing_heart": "😘",
"kissing": "😗",
"kissing_closed_eyes": "😚",
"kissing_smiling_eyes": "😙",
"yum": "😋",
"stuck_out_tongue": "😛",
"stuck_out_tongue_winking_eye": "😜",
"stuck_out_tongue_closed_eyes": "😝",
"neutral_face": "😐",
"expressionless": "😑",
"no_mouth": "😶",
"smirk": "😏",
"unamused": "😒",
"relieved": "😌",
"pensive": "😔",
"sleepy": "😪",
"sleeping": "😴",
"mask": "😷",
"dizzy_face": "😵",
"sunglasses": "😎",
"confused": "😕",
"worried": "😟",
"open_mouth": "😮",
"hushed": "😯",
"astonished": "😲",
"flushed": "😳",
"frowning": "😦",
"anguished": "😧",
"fearful": "😨",
"cold_sweat": "😰",
"disappointed_relieved": "😥",
"cry": "😢",
"sob": "😭",
"scream": "😱",
"confounded": "😖",
"persevere": "😣",
"disappointed": "😞",
"sweat": "😓",
"weary": "😩",
"tired_face": "😫",
"rage": "😡",
"pout": "😡",
"angry": "😠",
"smiling_imp": "😈",
"smiley_cat": "😺",
"smile_cat": "😸",
"joy_cat": "😹",
"heart_eyes_cat": "😻",
"smirk_cat": "😼",
"kissing_cat": "😽",
"scream_cat": "🙀",
"crying_cat_face": "😿",
"pouting_cat": "😾",
"heart": "❤️",
"hand": "✋",
"raised_hand": "✋",
"v": "✌️",
"point_up": "☝️",
"fist_raised": "✊",
"fist": "✊",
"monkey_face": "🐵",
"cat": "🐱",
"cow": "🐮",
"mouse": "🐭",
"coffee": "☕",
"hotsprings": "♨️",
"anchor": "⚓",
"airplane": "✈️",
"hourglass": "⌛",
"watch": "⌚",
"sunny": "☀️",
"star": "⭐",
"cloud": "☁️",
"umbrella": "☔",
"zap": "⚡",
"snowflake": "❄️",
"sparkles": "✨",
"black_joker": "🃏",
"mahjong": "🀄",
"phone": "☎️",
"telephone": "☎️",
"envelope": "✉️",
"pencil2": "✏️",
"black_nib": "✒️",
"scissors": "✂️",
"wheelchair": "♿",
"warning": "⚠️",
"aries": "♈",
"taurus": "♉",
"gemini": "♊",
"cancer": "♋",
"leo": "♌",
"virgo": "♍",
"libra": "♎",
"scorpius": "♏",
"sagittarius": "♐",
"capricorn": "♑",
"aquarius": "♒",
"pisces": "♓",
"heavy_multiplication_x": "✖️",
"heavy_plus_sign": "",
"heavy_minus_sign": "",
"heavy_division_sign": "➗",
"bangbang": "‼️",
"interrobang": "⁉️",
"question": "❓",
"grey_question": "❔",
"grey_exclamation": "❕",
"exclamation": "❗",
"heavy_exclamation_mark": "❗",
"wavy_dash": "〰️",
"recycle": "♻️",
"white_check_mark": "✅",
"ballot_box_with_check": "☑️",
"heavy_check_mark": "✔️",
"x": "❌",
"negative_squared_cross_mark": "❎",
"curly_loop": "➰",
"loop": "➿",
"part_alternation_mark": "〽️",
"eight_spoked_asterisk": "✳️",
"eight_pointed_black_star": "✴️",
"sparkle": "❇️",
"copyright": "©️",
"registered": "®️",
"tm": "™️",
"information_source": "",
"m": "Ⓜ️",
"black_circle": "⚫",
"white_circle": "⚪",
"black_large_square": "⬛",
"white_large_square": "⬜",
"black_medium_square": "◼️",
"white_medium_square": "◻️",
"black_medium_small_square": "◾",
"white_medium_small_square": "◽",
"black_small_square": "▪️",
"white_small_square": "▫️"
}

View File

@@ -0,0 +1,41 @@
// Emoticons -> Emoji mapping.
//
// (!) Some patterns skipped, to avoid collisions
// without increase matcher complicity. Than can change in future.
//
// Places to look for more emoticons info:
//
// - http://en.wikipedia.org/wiki/List_of_emoticons#Western
// - https://github.com/wooorm/emoticon/blob/master/Support.md
// - http://factoryjoe.com/projects/emoticons/
//
'use strict';
module.exports = {
angry: [ '>:(', '>:-(' ],
blush: [ ':")', ':-")' ],
broken_heart: [ '</3', '<\\3' ],
// :\ and :-\ not used because of conflict with markdown escaping
confused: [ ':/', ':-/' ], // twemoji shows question
cry: [ ":'(", ":'-(", ':,(', ':,-(' ],
frowning: [ ':(', ':-(' ],
heart: [ '<3' ],
imp: [ ']:(', ']:-(' ],
innocent: [ 'o:)', 'O:)', 'o:-)', 'O:-)', '0:)', '0:-)' ],
joy: [ ":')", ":'-)", ':,)', ':,-)', ":'D", ":'-D", ':,D', ':,-D' ],
kissing: [ ':*', ':-*' ],
laughing: [ 'x-)', 'X-)' ],
neutral_face: [ ':|', ':-|' ],
open_mouth: [ ':o', ':-o', ':O', ':-O' ],
rage: [ ':@', ':-@' ],
smile: [ ':D', ':-D' ],
smiley: [ ':)', ':-)' ],
smiling_imp: [ ']:)', ']:-)' ],
sob: [ ":,'(", ":,'-(", ';(', ';-(' ],
stuck_out_tongue: [ ':P', ':-P' ],
sunglasses: [ '8-)', 'B-)' ],
sweat: [ ',:(', ',:-(' ],
sweat_smile: [ ',:)', ',:-)' ],
unamused: [ ':s', ':-S', ':z', ':-Z', ':$', ':-$' ],
wink: [ ';)', ';-)' ]
};

View File

@@ -0,0 +1,67 @@
// Convert input options to more useable format
// and compile search regexp
'use strict';
function quoteRE(str) {
return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&');
}
module.exports = function normalize_opts(options) {
var emojies = options.defs,
shortcuts;
// Filter emojies by whitelist, if needed
if (options.enabled.length) {
emojies = Object.keys(emojies).reduce(function (acc, key) {
if (options.enabled.indexOf(key) >= 0) {
acc[key] = emojies[key];
}
return acc;
}, {});
}
// Flatten shortcuts to simple object: { alias: emoji_name }
shortcuts = Object.keys(options.shortcuts).reduce(function (acc, key) {
// Skip aliases for filtered emojies, to reduce regexp
if (!emojies[key]) { return acc; }
if (Array.isArray(options.shortcuts[key])) {
options.shortcuts[key].forEach(function (alias) {
acc[alias] = key;
});
return acc;
}
acc[options.shortcuts[key]] = key;
return acc;
}, {});
var keys = Object.keys(emojies),
names;
// If no definitions are given, return empty regex to avoid replacements with 'undefined'.
if (keys.length === 0) {
names = '^$';
} else {
// Compile regexp
names = keys
.map(function (name) { return ':' + name + ':'; })
.concat(Object.keys(shortcuts))
.sort()
.reverse()
.map(function (name) { return quoteRE(name); })
.join('|');
}
var scanRE = RegExp(names);
var replaceRE = RegExp(names, 'g');
return {
defs: emojies,
shortcuts: shortcuts,
scanRE: scanRE,
replaceRE: replaceRE
};
};

5
server/node_modules/markdown-it-emoji/lib/render.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
'use strict';
module.exports = function emoji_html(tokens, idx /*, options, env */) {
return tokens[idx].content;
};

89
server/node_modules/markdown-it-emoji/lib/replace.js generated vendored Normal file
View File

@@ -0,0 +1,89 @@
// Emojies & shortcuts replacement logic.
//
// Note: In theory, it could be faster to parse :smile: in inline chain and
// leave only shortcuts here. But, who care...
//
'use strict';
module.exports = function create_rule(md, emojies, shortcuts, scanRE, replaceRE) {
var arrayReplaceAt = md.utils.arrayReplaceAt,
ucm = md.utils.lib.ucmicro,
ZPCc = new RegExp([ ucm.Z.source, ucm.P.source, ucm.Cc.source ].join('|'));
function splitTextToken(text, level, Token) {
var token, last_pos = 0, nodes = [];
text.replace(replaceRE, function (match, offset, src) {
var emoji_name;
// Validate emoji name
if (shortcuts.hasOwnProperty(match)) {
// replace shortcut with full name
emoji_name = shortcuts[match];
// Don't allow letters before any shortcut (as in no ":/" in http://)
if (offset > 0 && !ZPCc.test(src[offset - 1])) {
return;
}
// Don't allow letters after any shortcut
if (offset + match.length < src.length && !ZPCc.test(src[offset + match.length])) {
return;
}
} else {
emoji_name = match.slice(1, -1);
}
// Add new tokens to pending list
if (offset > last_pos) {
token = new Token('text', '', 0);
token.content = text.slice(last_pos, offset);
nodes.push(token);
}
token = new Token('emoji', '', 0);
token.markup = emoji_name;
token.content = emojies[emoji_name];
nodes.push(token);
last_pos = offset + match.length;
});
if (last_pos < text.length) {
token = new Token('text', '', 0);
token.content = text.slice(last_pos);
nodes.push(token);
}
return nodes;
}
return function emoji_replace(state) {
var i, j, l, tokens, token,
blockTokens = state.tokens,
autolinkLevel = 0;
for (j = 0, l = blockTokens.length; j < l; j++) {
if (blockTokens[j].type !== 'inline') { continue; }
tokens = blockTokens[j].children;
// We scan from the end, to keep position when new tags added.
// Use reversed logic in links start/end match
for (i = tokens.length - 1; i >= 0; i--) {
token = tokens[i];
if (token.type === 'link_open' || token.type === 'link_close') {
if (token.info === 'auto') { autolinkLevel -= token.nesting; }
}
if (token.type === 'text' && autolinkLevel === 0 && scanRE.test(token.content)) {
// replace current node
blockTokens[j].children = tokens = arrayReplaceAt(
tokens, i, splitTextToken(token.content, token.level, state.Token)
);
}
}
}
};
};

19
server/node_modules/markdown-it-emoji/light.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
'use strict';
var emojies_defs = require('./lib/data/light.json');
var emojies_shortcuts = require('./lib/data/shortcuts');
var bare_emoji_plugin = require('./bare');
module.exports = function emoji_plugin(md, options) {
var defaults = {
defs: emojies_defs,
shortcuts: emojies_shortcuts,
enabled: []
};
var opts = md.utils.assign({}, defaults, options || {});
bare_emoji_plugin(md, opts);
};

43
server/node_modules/markdown-it-emoji/package.json generated vendored Normal file
View File

@@ -0,0 +1,43 @@
{
"name": "markdown-it-emoji",
"version": "2.0.2",
"description": "Emoji plugin for markdown-it markdown parser.",
"keywords": [
"markdown-it-plugin",
"markdown-it",
"markdown",
"emoji",
"emojies",
"emoticon",
"emoticons"
],
"repository": "markdown-it/markdown-it-emoji",
"license": "MIT",
"scripts": {
"lint": "eslint .",
"test": "npm run lint && nyc mocha",
"coverage": "npm run test && nyc report --reporter html",
"report-coveralls": "nyc report --reporter=text-lcov | coveralls",
"browserify": "rollup -c support/rollup.config.js"
},
"files": [
"index.js",
"light.js",
"bare.js",
"lib/",
"dist/"
],
"devDependencies": {
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"coveralls": "^3.1.0",
"eslint": "^7.11.0",
"markdown-it": "^12.0.0",
"markdown-it-testgen": "~0.1.0",
"mocha": "8.1.3",
"nyc": "^15.1.0",
"rollup": "^2.29.0",
"rollup-plugin-terser": "^7.0.2"
}
}