mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-21 14:13:36 +08:00
docs:更新文档
This commit is contained in:
62
node_modules/markdown-it-emoji/CHANGELOG.md
generated
vendored
Normal file
62
node_modules/markdown-it-emoji/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
1.4.0 / 2017-06-20
|
||||
------------------
|
||||
|
||||
- Emoji list update (full set only).
|
||||
|
||||
|
||||
1.3.0 / 2016-10-04
|
||||
------------------
|
||||
|
||||
- Emoji lists update.
|
||||
- Don't miss emojis with variation chars after.
|
||||
- Filter emojis with fake names ("uXXXX").
|
||||
|
||||
|
||||
1.2.0 / 2016-05-27
|
||||
------------------
|
||||
|
||||
- Don't apply replacements in auto-generated links.
|
||||
- More strong restrictions for aliaces - don't allow letters before and after.
|
||||
|
||||
|
||||
1.1.1 / 2016-03-24
|
||||
------------------
|
||||
|
||||
- Fixed shortcuts for `>:(` and `>:-(`.
|
||||
|
||||
|
||||
1.1.0 / 2015-08-13
|
||||
------------------
|
||||
|
||||
- Fixed improper names mapping.
|
||||
|
||||
|
||||
1.0.0 / 2015-03-12
|
||||
------------------
|
||||
|
||||
- Markdown-it 4.0.0 support. Use previous version for 2.x-3.x.
|
||||
|
||||
|
||||
0.1.3 / 2014-12-28
|
||||
------------------
|
||||
|
||||
- Removed conflicting shortcuts :/ & :\ until logic improved
|
||||
|
||||
|
||||
0.1.2 / 2014-12-24
|
||||
------------------
|
||||
|
||||
- Updated emoticon shortcuts
|
||||
|
||||
|
||||
0.1.1 / 2014-12-23
|
||||
------------------
|
||||
|
||||
- Updated twemoji instructions.
|
||||
- Minor code & tests cleanup.
|
||||
|
||||
|
||||
0.1.0 / 2014-12-22
|
||||
------------------
|
||||
|
||||
- First release.
|
||||
22
node_modules/markdown-it-emoji/LICENSE
generated
vendored
Normal file
22
node_modules/markdown-it-emoji/LICENSE
generated
vendored
Normal 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.
|
||||
101
node_modules/markdown-it-emoji/README.md
generated
vendored
Normal file
101
node_modules/markdown-it-emoji/README.md
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
# markdown-it-emoji
|
||||
|
||||
[](https://travis-ci.org/markdown-it/markdown-it-emoji)
|
||||
[](https://www.npmjs.org/package/markdown-it-emoji)
|
||||
[](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.__
|
||||
|
||||
Two 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.
|
||||
|
||||
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)
|
||||
383
node_modules/markdown-it-emoji/dist/markdown-it-emoji-light.js
generated
vendored
Normal file
383
node_modules/markdown-it-emoji/dist/markdown-it-emoji-light.js
generated
vendored
Normal file
@@ -0,0 +1,383 @@
|
||||
/*! markdown-it-emoji 1.4.0 https://github.com//markdown-it/markdown-it-emoji @license MIT */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.markdownitEmoji = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
module.exports={
|
||||
"grinning": "😀",
|
||||
"smiley": "😃",
|
||||
"smile": "😄",
|
||||
"grin": "😁",
|
||||
"laughing": "😆",
|
||||
"satisfied": "😆",
|
||||
"sweat_smile": "😅",
|
||||
"joy": "😂",
|
||||
"blush": "😊",
|
||||
"innocent": "😇",
|
||||
"wink": "😉",
|
||||
"relieved": "😌",
|
||||
"heart_eyes": "😍",
|
||||
"kissing_heart": "😘",
|
||||
"kissing": "😗",
|
||||
"kissing_smiling_eyes": "😙",
|
||||
"kissing_closed_eyes": "😚",
|
||||
"yum": "😋",
|
||||
"stuck_out_tongue_winking_eye": "😜",
|
||||
"stuck_out_tongue_closed_eyes": "😝",
|
||||
"stuck_out_tongue": "😛",
|
||||
"sunglasses": "😎",
|
||||
"smirk": "😏",
|
||||
"unamused": "😒",
|
||||
"disappointed": "😞",
|
||||
"pensive": "😔",
|
||||
"worried": "😟",
|
||||
"confused": "😕",
|
||||
"persevere": "😣",
|
||||
"confounded": "😖",
|
||||
"tired_face": "😫",
|
||||
"weary": "😩",
|
||||
"angry": "😠",
|
||||
"rage": "😡",
|
||||
"pout": "😡",
|
||||
"no_mouth": "😶",
|
||||
"neutral_face": "😐",
|
||||
"expressionless": "😑",
|
||||
"hushed": "😯",
|
||||
"frowning": "😦",
|
||||
"anguished": "😧",
|
||||
"open_mouth": "😮",
|
||||
"astonished": "😲",
|
||||
"dizzy_face": "😵",
|
||||
"flushed": "😳",
|
||||
"scream": "😱",
|
||||
"fearful": "😨",
|
||||
"cold_sweat": "😰",
|
||||
"cry": "😢",
|
||||
"disappointed_relieved": "😥",
|
||||
"sob": "😭",
|
||||
"sweat": "😓",
|
||||
"sleepy": "😪",
|
||||
"sleeping": "😴",
|
||||
"mask": "😷",
|
||||
"smiling_imp": "😈",
|
||||
"smiley_cat": "😺",
|
||||
"smile_cat": "😸",
|
||||
"joy_cat": "😹",
|
||||
"heart_eyes_cat": "😻",
|
||||
"smirk_cat": "😼",
|
||||
"kissing_cat": "😽",
|
||||
"scream_cat": "🙀",
|
||||
"crying_cat_face": "😿",
|
||||
"pouting_cat": "😾",
|
||||
"fist_raised": "✊",
|
||||
"fist": "✊",
|
||||
"v": "✌️",
|
||||
"point_up": "☝️",
|
||||
"hand": "✋",
|
||||
"raised_hand": "✋",
|
||||
"cat": "🐱",
|
||||
"mouse": "🐭",
|
||||
"cow": "🐮",
|
||||
"monkey_face": "🐵",
|
||||
"star": "⭐️",
|
||||
"sparkles": "✨",
|
||||
"zap": "⚡️",
|
||||
"sunny": "☀️",
|
||||
"cloud": "☁️",
|
||||
"snowflake": "❄️",
|
||||
"umbrella": "☔️",
|
||||
"coffee": "☕️",
|
||||
"airplane": "✈️",
|
||||
"anchor": "⚓️",
|
||||
"watch": "⌚️",
|
||||
"phone": "☎️",
|
||||
"telephone": "☎️",
|
||||
"hourglass": "⌛️",
|
||||
"email": "✉️",
|
||||
"envelope": "✉️",
|
||||
"scissors": "✂️",
|
||||
"black_nib": "✒️",
|
||||
"pencil2": "✏️",
|
||||
"heart": "❤️",
|
||||
"aries": "♈️",
|
||||
"taurus": "♉️",
|
||||
"gemini": "♊️",
|
||||
"cancer": "♋️",
|
||||
"leo": "♌️",
|
||||
"virgo": "♍️",
|
||||
"libra": "♎️",
|
||||
"scorpius": "♏️",
|
||||
"sagittarius": "♐️",
|
||||
"capricorn": "♑️",
|
||||
"aquarius": "♒️",
|
||||
"pisces": "♓️",
|
||||
"eight_pointed_black_star": "✴️",
|
||||
"x": "❌",
|
||||
"hotsprings": "♨️",
|
||||
"exclamation": "❗️",
|
||||
"heavy_exclamation_mark": "❗️",
|
||||
"grey_exclamation": "❕",
|
||||
"question": "❓",
|
||||
"grey_question": "❔",
|
||||
"bangbang": "‼️",
|
||||
"interrobang": "⁉️",
|
||||
"part_alternation_mark": "〽️",
|
||||
"warning": "⚠️",
|
||||
"recycle": "♻️",
|
||||
"white_check_mark": "✅",
|
||||
"sparkle": "❇️",
|
||||
"eight_spoked_asterisk": "✳️",
|
||||
"negative_squared_cross_mark": "❎",
|
||||
"m": "Ⓜ️",
|
||||
"wheelchair": "♿️",
|
||||
"information_source": "ℹ️",
|
||||
"heavy_plus_sign": "➕",
|
||||
"heavy_minus_sign": "➖",
|
||||
"heavy_division_sign": "➗",
|
||||
"heavy_multiplication_x": "✖️",
|
||||
"tm": "™️",
|
||||
"copyright": "©️",
|
||||
"registered": "®️",
|
||||
"wavy_dash": "〰️",
|
||||
"curly_loop": "➰",
|
||||
"loop": "➿",
|
||||
"heavy_check_mark": "✔️",
|
||||
"ballot_box_with_check": "☑️",
|
||||
"white_circle": "⚪️",
|
||||
"black_circle": "⚫️",
|
||||
"black_small_square": "▪️",
|
||||
"white_small_square": "▫️",
|
||||
"black_medium_small_square": "◾️",
|
||||
"white_medium_small_square": "◽️",
|
||||
"black_medium_square": "◼️",
|
||||
"white_medium_square": "◻️",
|
||||
"black_large_square": "⬛️",
|
||||
"white_large_square": "⬜️",
|
||||
"black_joker": "🃏",
|
||||
"mahjong": "🀄️"
|
||||
}
|
||||
},{}],2:[function(require,module,exports){
|
||||
// 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: [ ';)', ';-)' ]
|
||||
};
|
||||
|
||||
},{}],3:[function(require,module,exports){
|
||||
// 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;
|
||||
}, {});
|
||||
|
||||
// Compile regexp
|
||||
var names = Object.keys(emojies)
|
||||
.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
|
||||
};
|
||||
};
|
||||
|
||||
},{}],4:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
module.exports = function emoji_html(tokens, idx /*, options, env */) {
|
||||
return tokens[idx].content;
|
||||
};
|
||||
|
||||
},{}],5:[function(require,module,exports){
|
||||
// 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)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
},{}],6:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
||||
var emojies_defs = require('./lib/data/light.json');
|
||||
var emojies_shortcuts = require('./lib/data/shortcuts');
|
||||
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: emojies_defs,
|
||||
shortcuts: emojies_shortcuts,
|
||||
enabled: []
|
||||
};
|
||||
|
||||
var opts = normalize_opts(md.utils.assign({}, defaults, options || {}));
|
||||
|
||||
md.renderer.rules.emoji = emoji_html;
|
||||
|
||||
md.core.ruler.push('emoji', emoji_replace(md, opts.defs, opts.shortcuts, opts.scanRE, opts.replaceRE));
|
||||
};
|
||||
|
||||
},{"./lib/data/light.json":1,"./lib/data/shortcuts":2,"./lib/normalize_opts":3,"./lib/render":4,"./lib/replace":5}]},{},[6])(6)
|
||||
});
|
||||
2
node_modules/markdown-it-emoji/dist/markdown-it-emoji-light.min.js
generated
vendored
Normal file
2
node_modules/markdown-it-emoji/dist/markdown-it-emoji-light.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1712
node_modules/markdown-it-emoji/dist/markdown-it-emoji.js
generated
vendored
Normal file
1712
node_modules/markdown-it-emoji/dist/markdown-it-emoji.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3
node_modules/markdown-it-emoji/dist/markdown-it-emoji.min.js
generated
vendored
Normal file
3
node_modules/markdown-it-emoji/dist/markdown-it-emoji.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
23
node_modules/markdown-it-emoji/index.js
generated
vendored
Normal file
23
node_modules/markdown-it-emoji/index.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
var emojies_defs = require('./lib/data/full.json');
|
||||
var emojies_shortcuts = require('./lib/data/shortcuts');
|
||||
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: emojies_defs,
|
||||
shortcuts: emojies_shortcuts,
|
||||
enabled: []
|
||||
};
|
||||
|
||||
var opts = normalize_opts(md.utils.assign({}, defaults, options || {}));
|
||||
|
||||
md.renderer.rules.emoji = emoji_html;
|
||||
|
||||
md.core.ruler.push('emoji', emoji_replace(md, opts.defs, opts.shortcuts, opts.scanRE, opts.replaceRE));
|
||||
};
|
||||
1482
node_modules/markdown-it-emoji/lib/data/full.json
generated
vendored
Normal file
1482
node_modules/markdown-it-emoji/lib/data/full.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
153
node_modules/markdown-it-emoji/lib/data/light.json
generated
vendored
Normal file
153
node_modules/markdown-it-emoji/lib/data/light.json
generated
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
{
|
||||
"grinning": "😀",
|
||||
"smiley": "😃",
|
||||
"smile": "😄",
|
||||
"grin": "😁",
|
||||
"laughing": "😆",
|
||||
"satisfied": "😆",
|
||||
"sweat_smile": "😅",
|
||||
"joy": "😂",
|
||||
"blush": "😊",
|
||||
"innocent": "😇",
|
||||
"wink": "😉",
|
||||
"relieved": "😌",
|
||||
"heart_eyes": "😍",
|
||||
"kissing_heart": "😘",
|
||||
"kissing": "😗",
|
||||
"kissing_smiling_eyes": "😙",
|
||||
"kissing_closed_eyes": "😚",
|
||||
"yum": "😋",
|
||||
"stuck_out_tongue_winking_eye": "😜",
|
||||
"stuck_out_tongue_closed_eyes": "😝",
|
||||
"stuck_out_tongue": "😛",
|
||||
"sunglasses": "😎",
|
||||
"smirk": "😏",
|
||||
"unamused": "😒",
|
||||
"disappointed": "😞",
|
||||
"pensive": "😔",
|
||||
"worried": "😟",
|
||||
"confused": "😕",
|
||||
"persevere": "😣",
|
||||
"confounded": "😖",
|
||||
"tired_face": "😫",
|
||||
"weary": "😩",
|
||||
"angry": "😠",
|
||||
"rage": "😡",
|
||||
"pout": "😡",
|
||||
"no_mouth": "😶",
|
||||
"neutral_face": "😐",
|
||||
"expressionless": "😑",
|
||||
"hushed": "😯",
|
||||
"frowning": "😦",
|
||||
"anguished": "😧",
|
||||
"open_mouth": "😮",
|
||||
"astonished": "😲",
|
||||
"dizzy_face": "😵",
|
||||
"flushed": "😳",
|
||||
"scream": "😱",
|
||||
"fearful": "😨",
|
||||
"cold_sweat": "😰",
|
||||
"cry": "😢",
|
||||
"disappointed_relieved": "😥",
|
||||
"sob": "😭",
|
||||
"sweat": "😓",
|
||||
"sleepy": "😪",
|
||||
"sleeping": "😴",
|
||||
"mask": "😷",
|
||||
"smiling_imp": "😈",
|
||||
"smiley_cat": "😺",
|
||||
"smile_cat": "😸",
|
||||
"joy_cat": "😹",
|
||||
"heart_eyes_cat": "😻",
|
||||
"smirk_cat": "😼",
|
||||
"kissing_cat": "😽",
|
||||
"scream_cat": "🙀",
|
||||
"crying_cat_face": "😿",
|
||||
"pouting_cat": "😾",
|
||||
"fist_raised": "✊",
|
||||
"fist": "✊",
|
||||
"v": "✌️",
|
||||
"point_up": "☝️",
|
||||
"hand": "✋",
|
||||
"raised_hand": "✋",
|
||||
"cat": "🐱",
|
||||
"mouse": "🐭",
|
||||
"cow": "🐮",
|
||||
"monkey_face": "🐵",
|
||||
"star": "⭐️",
|
||||
"sparkles": "✨",
|
||||
"zap": "⚡️",
|
||||
"sunny": "☀️",
|
||||
"cloud": "☁️",
|
||||
"snowflake": "❄️",
|
||||
"umbrella": "☔️",
|
||||
"coffee": "☕️",
|
||||
"airplane": "✈️",
|
||||
"anchor": "⚓️",
|
||||
"watch": "⌚️",
|
||||
"phone": "☎️",
|
||||
"telephone": "☎️",
|
||||
"hourglass": "⌛️",
|
||||
"email": "✉️",
|
||||
"envelope": "✉️",
|
||||
"scissors": "✂️",
|
||||
"black_nib": "✒️",
|
||||
"pencil2": "✏️",
|
||||
"heart": "❤️",
|
||||
"aries": "♈️",
|
||||
"taurus": "♉️",
|
||||
"gemini": "♊️",
|
||||
"cancer": "♋️",
|
||||
"leo": "♌️",
|
||||
"virgo": "♍️",
|
||||
"libra": "♎️",
|
||||
"scorpius": "♏️",
|
||||
"sagittarius": "♐️",
|
||||
"capricorn": "♑️",
|
||||
"aquarius": "♒️",
|
||||
"pisces": "♓️",
|
||||
"eight_pointed_black_star": "✴️",
|
||||
"x": "❌",
|
||||
"hotsprings": "♨️",
|
||||
"exclamation": "❗️",
|
||||
"heavy_exclamation_mark": "❗️",
|
||||
"grey_exclamation": "❕",
|
||||
"question": "❓",
|
||||
"grey_question": "❔",
|
||||
"bangbang": "‼️",
|
||||
"interrobang": "⁉️",
|
||||
"part_alternation_mark": "〽️",
|
||||
"warning": "⚠️",
|
||||
"recycle": "♻️",
|
||||
"white_check_mark": "✅",
|
||||
"sparkle": "❇️",
|
||||
"eight_spoked_asterisk": "✳️",
|
||||
"negative_squared_cross_mark": "❎",
|
||||
"m": "Ⓜ️",
|
||||
"wheelchair": "♿️",
|
||||
"information_source": "ℹ️",
|
||||
"heavy_plus_sign": "➕",
|
||||
"heavy_minus_sign": "➖",
|
||||
"heavy_division_sign": "➗",
|
||||
"heavy_multiplication_x": "✖️",
|
||||
"tm": "™️",
|
||||
"copyright": "©️",
|
||||
"registered": "®️",
|
||||
"wavy_dash": "〰️",
|
||||
"curly_loop": "➰",
|
||||
"loop": "➿",
|
||||
"heavy_check_mark": "✔️",
|
||||
"ballot_box_with_check": "☑️",
|
||||
"white_circle": "⚪️",
|
||||
"black_circle": "⚫️",
|
||||
"black_small_square": "▪️",
|
||||
"white_small_square": "▫️",
|
||||
"black_medium_small_square": "◾️",
|
||||
"white_medium_small_square": "◽️",
|
||||
"black_medium_square": "◼️",
|
||||
"white_medium_square": "◻️",
|
||||
"black_large_square": "⬛️",
|
||||
"white_large_square": "⬜️",
|
||||
"black_joker": "🃏",
|
||||
"mahjong": "🀄️"
|
||||
}
|
||||
41
node_modules/markdown-it-emoji/lib/data/shortcuts.js
generated
vendored
Normal file
41
node_modules/markdown-it-emoji/lib/data/shortcuts.js
generated
vendored
Normal 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: [ ';)', ';-)' ]
|
||||
};
|
||||
59
node_modules/markdown-it-emoji/lib/normalize_opts.js
generated
vendored
Normal file
59
node_modules/markdown-it-emoji/lib/normalize_opts.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
// 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;
|
||||
}, {});
|
||||
|
||||
// Compile regexp
|
||||
var names = Object.keys(emojies)
|
||||
.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
node_modules/markdown-it-emoji/lib/render.js
generated
vendored
Normal file
5
node_modules/markdown-it-emoji/lib/render.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function emoji_html(tokens, idx /*, options, env */) {
|
||||
return tokens[idx].content;
|
||||
};
|
||||
89
node_modules/markdown-it-emoji/lib/replace.js
generated
vendored
Normal file
89
node_modules/markdown-it-emoji/lib/replace.js
generated
vendored
Normal 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)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
23
node_modules/markdown-it-emoji/light.js
generated
vendored
Normal file
23
node_modules/markdown-it-emoji/light.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
var emojies_defs = require('./lib/data/light.json');
|
||||
var emojies_shortcuts = require('./lib/data/shortcuts');
|
||||
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: emojies_defs,
|
||||
shortcuts: emojies_shortcuts,
|
||||
enabled: []
|
||||
};
|
||||
|
||||
var opts = normalize_opts(md.utils.assign({}, defaults, options || {}));
|
||||
|
||||
md.renderer.rules.emoji = emoji_html;
|
||||
|
||||
md.core.ruler.push('emoji', emoji_replace(md, opts.defs, opts.shortcuts, opts.scanRE, opts.replaceRE));
|
||||
};
|
||||
74
node_modules/markdown-it-emoji/package.json
generated
vendored
Normal file
74
node_modules/markdown-it-emoji/package.json
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"markdown-it-emoji@1.4.0",
|
||||
"J:\\Github\\CURD-TS"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "markdown-it-emoji@1.4.0",
|
||||
"_id": "markdown-it-emoji@1.4.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-m+4OmpkKljupbfaYDE/dsF37Tcw=",
|
||||
"_location": "/markdown-it-emoji",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "markdown-it-emoji@1.4.0",
|
||||
"name": "markdown-it-emoji",
|
||||
"escapedName": "markdown-it-emoji",
|
||||
"rawSpec": "1.4.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.4.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/vitepress"
|
||||
],
|
||||
"_resolved": "http://192.168.250.101:4873/markdown-it-emoji/-/markdown-it-emoji-1.4.0.tgz",
|
||||
"_spec": "1.4.0",
|
||||
"_where": "J:\\Github\\CURD-TS",
|
||||
"bugs": {
|
||||
"url": "https://github.com/markdown-it/markdown-it-emoji/issues"
|
||||
},
|
||||
"description": "Emoji plugin for markdown-it markdown parser.",
|
||||
"devDependencies": {
|
||||
"browserify": "*",
|
||||
"coveralls": "^2.11.2",
|
||||
"eslint": "^3.7.0",
|
||||
"istanbul": "*",
|
||||
"lodash": "^4.16.2",
|
||||
"markdown-it": "^6.0.0",
|
||||
"markdown-it-testgen": "~0.1.0",
|
||||
"mocha": "*",
|
||||
"request": "*",
|
||||
"uglify-js": "*"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"light.js",
|
||||
"lib/",
|
||||
"dist/"
|
||||
],
|
||||
"homepage": "https://github.com/markdown-it/markdown-it-emoji",
|
||||
"keywords": [
|
||||
"markdown-it-plugin",
|
||||
"markdown-it",
|
||||
"markdown",
|
||||
"emoji",
|
||||
"emojies",
|
||||
"emoticon",
|
||||
"emoticons"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "markdown-it-emoji",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/markdown-it/markdown-it-emoji.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
},
|
||||
"version": "1.4.0"
|
||||
}
|
||||
Reference in New Issue
Block a user