ui: remove emojify.js

This commit is contained in:
undefined committed 2021-10-10 16:27:23 +08:00
1 parent 84c38cb571
commit 5f527658f8
27 files changed
+57 -138

No files matched your search

@@ -70,7 +70,7 @@ function addInvisibles(grammar) {
for (const name in grammar) {
if (Object.prototype.hasOwnProperty.call(grammar, name) && !invisibles[name]) {
if (name === 'rest') addInvisibles(grammar.rest);
else handlerInvisiblesToken(grammar, name); // eslint-disable-line no-use-before-define
else handlerInvisiblesToken(grammar, name); // eslint-disable-line @typescript-eslint/no-use-before-define
}
}
}
@@ -95,19 +95,12 @@ Prism.hooks.add('before-highlight', (env) => {
});
const prismjsApiWrap = {
highlightBlocks: ($dom, format) => {
highlightBlocks: ($dom) => {
$dom.find('pre code').get().forEach((code) => {
const $code = $(code);
const $pre = $code.parent();
$pre.addClass('syntax-hl');
const language = ($(code).attr('class') || '').trim();
const astyle = language.match(/astyle-([a-z]+)/);
if (format && astyle && astyle[1]) {
const [success, result] = format($code.text(), `${UserContext.astyleOptions.trim()} mode=${astyle[1]}`);
code.original = $code.text();
if (!success) Notification.error('Code format fail');
else $code.text(result);
}
// try to map the language name
const m = language.match(/language-([a-z]+)/);
if (m && m[1]) {