Authored by shuaiguo

使用emoji-aware移除emoji

/* eslint-disable indent */
import { get, first } from 'lodash';
import emojiRegex from 'emoji-regex';
import { withoutEmoji } from 'emoji-aware';
function _version2num(version) {
if (!version) {
... ... @@ -56,7 +57,6 @@ function ClearBr(key) {
// eslint-disable-next-line no-unused-vars
const getDetailShareData = (article, app_version = '6.9.11') => {
let shareImage = '';
let desc = '';
if (article.sort === 2) {
... ... @@ -96,13 +96,13 @@ const getDetailShareData = (article, app_version = '6.9.11') => {
let authorName = article.authorName || '';
// 过滤掉emoji表情
// desc = filterEmoji(desc);
// authorName = filterEmoji(article.authorName || '');
// 过滤掉换行
desc = ClearBr(desc);
authorName = ClearBr(article.authorName || '');
// desc = ClearBr(desc);
// authorName = ClearBr(article.authorName || '');
// 过滤掉emoji表情
desc = withoutEmoji(desc).join('');
authorName = withoutEmoji(article.authorName || '').join('');
return {
title: `@${authorName} 在有货社区上发了一篇内容,快点开看看!`,
... ...
{
"name": "yoho-community-web",
"version": "6.9.14-beta-4",
"version": "6.9.14-beta-5",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ... @@ -45,6 +45,7 @@
"cors": "^2.8.5",
"cube-ui": "^1.12.6",
"dayjs": "^1.8.5",
"emoji-aware": "^3.0.5",
"emoji-regex": "^8.0.0",
"express": "^4.16.4",
"express-session": "^1.15.6",
... ...
... ... @@ -2828,6 +2828,14 @@ elliptic@^6.0.0:
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.0"
emoji-aware@^3.0.5:
version "3.0.5"
resolved "http://npm.yohops.com/emoji-aware/-/emoji-aware-3.0.5.tgz#69a1a9e49eec9bf85d601232c853cac3fea443eb"
integrity sha1-aaGp5J7sm/hdYBIyyFPKw/6kQ+s=
dependencies:
lodash.flattendeep "^4.4.0"
parsimmon "^1.13.0"
emoji-regex@^7.0.1:
version "7.0.3"
resolved "http://npm.yohops.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
... ... @@ -5036,6 +5044,11 @@ lodash.findkey@^4.6.0:
version "4.6.0"
resolved "http://npm.yohops.com/lodash.findkey/-/lodash.findkey-4.6.0.tgz#83058e903b51cbb759d09ccf546dea3ea39c4718"
lodash.flattendeep@^4.4.0:
version "4.4.0"
resolved "http://npm.yohops.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2"
integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=
lodash.kebabcase@^4.1.1:
version "4.1.1"
resolved "http://npm.yohops.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36"
... ... @@ -6172,6 +6185,11 @@ parseurl@~1.3.1, parseurl@~1.3.2:
version "1.3.2"
resolved "http://npm.yohops.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3"
parsimmon@^1.13.0:
version "1.13.0"
resolved "http://npm.yohops.com/parsimmon/-/parsimmon-1.13.0.tgz#6e4ef3dbd45ed6ea6808be600ac4b9c8a44228cf"
integrity sha1-bk7z29Re1upoCL5gCsS5yKRCKM8=
pascalcase@^0.1.1:
version "0.1.1"
resolved "http://npm.yohops.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"
... ...