From 0c4e36aa55359c1d53e6e96b5bd254aaeceb61ae Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 2 Sep 2019 17:33:09 -0700 Subject: [PATCH] Removing markdown-it-emoji from index.html --- ui/assets/libs/markdown-it-emoji/markdown-it-emoji.min.js | 3 --- ui/package.json | 1 + ui/src/index.html | 1 - ui/src/utils.ts | 2 +- ui/yarn.lock | 5 +++++ 5 files changed, 7 insertions(+), 5 deletions(-) delete mode 100644 ui/assets/libs/markdown-it-emoji/markdown-it-emoji.min.js diff --git a/ui/assets/libs/markdown-it-emoji/markdown-it-emoji.min.js b/ui/assets/libs/markdown-it-emoji/markdown-it-emoji.min.js deleted file mode 100644 index feee94b62..000000000 --- a/ui/assets/libs/markdown-it-emoji/markdown-it-emoji.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! markdown-it-emoji 1.4.0 https://github.com//markdown-it/markdown-it-emoji @license MIT */ -!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.markdownitEmoji=a()}}(function(){return function a(e,n,o){function i(_,t){if(!n[_]){if(!e[_]){var s="function"==typeof require&&require;if(!t&&s)return s(_,!0);if(r)return r(_,!0);var l=new Error("Cannot find module '"+_+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[_]={exports:{}};e[_][0].call(c.exports,function(a){var n=e[_][1][a];return i(n?n:a)},c,c.exports,a,e,n,o)}return n[_].exports}for(var r="function"==typeof require&&require,_=0;_:(",">:-("],blush:[':")',':-")'],broken_heart:["=0&&(e[o]=n[o]),e},{})),e=Object.keys(a.shortcuts).reduce(function(e,o){return n[o]?Array.isArray(a.shortcuts[o])?(a.shortcuts[o].forEach(function(a){e[a]=o}),e):(e[a.shortcuts[o]]=o,e):e},{});var i=Object.keys(n).map(function(a){return":"+a+":"}).concat(Object.keys(e)).sort().reverse().map(function(a){return o(a)}).join("|"),r=RegExp(i),_=RegExp(i,"g");return{defs:n,shortcuts:e,scanRE:r,replaceRE:_}}},{}],4:[function(a,e,n){"use strict";e.exports=function(a,e){return a[e].content}},{}],5:[function(a,e,n){"use strict";e.exports=function(a,e,n,o,i){function r(a,o,r){var _,t=0,l=[];return a.replace(i,function(o,i,c){var m;if(n.hasOwnProperty(o)){if(m=n[o],i>0&&!s.test(c[i-1]))return;if(i+o.lengtht&&(_=new r("text","",0),_.content=a.slice(t,i),l.push(_)),_=new r("emoji","",0),_.markup=m,_.content=e[m],l.push(_),t=i+o.length}),t=0;e--)s=t[e],"link_open"!==s.type&&"link_close"!==s.type||"auto"===s.info&&(c-=s.nesting),"text"===s.type&&0===c&&o.test(s.content)&&(l[n].children=t=_(t,e,r(s.content,s.level,a.Token)))}}},{}],6:[function(a,e,n){"use strict";var o=a("./lib/data/full.json"),i=a("./lib/data/shortcuts"),r=a("./lib/render"),_=a("./lib/replace"),t=a("./lib/normalize_opts");e.exports=function(a,e){var n={defs:o,shortcuts:i,enabled:[]},s=t(a.utils.assign({},n,e||{}));a.renderer.rules.emoji=r,a.core.ruler.push("emoji",_(a,s.defs,s.shortcuts,s.scanRE,s.replaceRE))}},{"./lib/data/full.json":1,"./lib/data/shortcuts":2,"./lib/normalize_opts":3,"./lib/render":4,"./lib/replace":5}]},{},[6])(6)}); diff --git a/ui/package.json b/ui/package.json index 22c33c00d..1942449ee 100644 --- a/ui/package.json +++ b/ui/package.json @@ -31,6 +31,7 @@ "jwt-decode": "^2.2.0", "markdown-it": "^8.4.2", "markdown-it-container": "^2.0.0", + "markdown-it-emoji": "^1.4.0", "moment": "^2.24.0", "rxjs": "^6.4.0", "terser": "^3.17.0", diff --git a/ui/src/index.html b/ui/src/index.html index 4dbde8b07..b06b2df74 100644 --- a/ui/src/index.html +++ b/ui/src/index.html @@ -9,7 +9,6 @@ - diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 6477ca8ae..30080fb7b 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -9,7 +9,7 @@ import 'moment/locale/nl'; import { UserOperation, Comment, User, SortType, ListingType } from './interfaces'; import * as markdown_it from 'markdown-it'; -declare var markdownitEmoji: any; +import * as markdownitEmoji from 'markdown-it-emoji/light'; import * as markdown_it_container from 'markdown-it-container'; import * as twemoji from 'twemoji'; import { twemojis } from './twemojis'; diff --git a/ui/yarn.lock b/ui/yarn.lock index 84cd5a00c..caaa34ccf 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -2001,6 +2001,11 @@ markdown-it-container@^2.0.0: resolved "https://registry.yarnpkg.com/markdown-it-container/-/markdown-it-container-2.0.0.tgz#0019b43fd02eefece2f1960a2895fba81a404695" integrity sha1-ABm0P9Au7+zi8ZYKKJX7qBpARpU= +markdown-it-emoji@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/markdown-it-emoji/-/markdown-it-emoji-1.4.0.tgz#9bee0e9a990a963ba96df6980c4fddb05dfb4dcc" + integrity sha1-m+4OmpkKljupbfaYDE/dsF37Tcw= + markdown-it@^8.4.2: version "8.4.2" resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-8.4.2.tgz#386f98998dc15a37722aa7722084f4020bdd9b54"