@ecency/render-helper 2.4.7 → 2.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +30 -17
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +30 -17
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +30 -17
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.cjs
CHANGED
|
@@ -38,13 +38,6 @@ var he__default = /*#__PURE__*/_interopDefault(he);
|
|
|
38
38
|
var htmlparser2__namespace = /*#__PURE__*/_interopNamespace(htmlparser2);
|
|
39
39
|
var domSerializerModule__namespace = /*#__PURE__*/_interopNamespace(domSerializerModule);
|
|
40
40
|
|
|
41
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
42
|
-
get: (a2, b) => (typeof require !== "undefined" ? require : a2)[b]
|
|
43
|
-
}) : x)(function(x) {
|
|
44
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
45
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
41
|
// src/consts/white-list.const.ts
|
|
49
42
|
var WHITE_LIST = [
|
|
50
43
|
"ecency.com",
|
|
@@ -900,7 +893,7 @@ function a(el, forApp, webp, parentDomain = "ecency.com") {
|
|
|
900
893
|
const imgEls2 = el.getElementsByTagName("img");
|
|
901
894
|
if (imgEls2.length === 1 || el.textContent.trim() === href) {
|
|
902
895
|
if ((match[1] || match[2]) && match[3]) {
|
|
903
|
-
const videoHref = `https://3speak.tv/
|
|
896
|
+
const videoHref = `https://play.3speak.tv/watch?v=${match[3]}&mode=iframe`;
|
|
904
897
|
el.setAttribute("class", "markdown-video-link markdown-video-link-speak");
|
|
905
898
|
el.removeAttribute("href");
|
|
906
899
|
el.setAttribute("data-embed-src", videoHref);
|
|
@@ -1033,7 +1026,11 @@ function iframe(el, parentDomain = "ecency.com") {
|
|
|
1033
1026
|
return;
|
|
1034
1027
|
}
|
|
1035
1028
|
if (src.match(SPEAK_EMBED_REGEX)) {
|
|
1036
|
-
let normalizedSrc = src.replace(/3speak\.[a-z]+/i, "3speak.tv");
|
|
1029
|
+
let normalizedSrc = src.replace(/3speak\.[a-z]+/i, "play.3speak.tv");
|
|
1030
|
+
const hasMode = /[?&]mode=/.test(normalizedSrc);
|
|
1031
|
+
if (!hasMode) {
|
|
1032
|
+
normalizedSrc = `${normalizedSrc}&mode=iframe`;
|
|
1033
|
+
}
|
|
1037
1034
|
const hasAutoplay = /[?&]autoplay=/.test(normalizedSrc);
|
|
1038
1035
|
const s = hasAutoplay ? normalizedSrc : `${normalizedSrc}&autoplay=true`;
|
|
1039
1036
|
el.setAttribute("src", s);
|
|
@@ -1308,16 +1305,32 @@ function cleanReply(s) {
|
|
|
1308
1305
|
return (s ? s.split("\n").filter((item) => item.toLowerCase().includes("posted using [partiko") === false).filter((item) => item.toLowerCase().includes("posted using [dapplr") === false).filter((item) => item.toLowerCase().includes("posted using [leofinance") === false).filter((item) => item.toLowerCase().includes("posted via [neoxian") === false).filter((item) => item.toLowerCase().includes("posted using [neoxian") === false).filter((item) => item.toLowerCase().includes("posted with [stemgeeks") === false).filter((item) => item.toLowerCase().includes("posted using [bilpcoin") === false).filter((item) => item.toLowerCase().includes("posted using [inleo") === false).filter((item) => item.toLowerCase().includes("posted using [sportstalksocial]") === false).filter((item) => item.toLowerCase().includes("<center><sub>[posted using aeneas.blog") === false).filter((item) => item.toLowerCase().includes("<center><sub>posted via [proofofbrain.io") === false).filter((item) => item.toLowerCase().includes("<center>posted on [hypnochain") === false).filter((item) => item.toLowerCase().includes("<center><sub>posted via [weedcash.network") === false).filter((item) => item.toLowerCase().includes("<center>posted on [naturalmedicine.io") === false).filter((item) => item.toLowerCase().includes("<center><sub>posted via [musicforlife.io") === false).filter((item) => item.toLowerCase().includes("if the truvvl embed is unsupported by your current frontend, click this link to view this story") === false).filter((item) => item.toLowerCase().includes("<center><em>posted from truvvl") === false).filter((item) => item.toLowerCase().includes('view this post <a href="https://travelfeed.io/') === false).filter((item) => item.toLowerCase().includes("read this post on travelfeed.io for the best experience") === false).filter((item) => item.toLowerCase().includes('posted via <a href="https://www.dporn.co/"') === false).filter((item) => item.toLowerCase().includes("\u25B6\uFE0F [watch on 3speak](https://3speak") === false).filter((item) => item.toLowerCase().includes("<sup><sub>posted via [inji.com]") === false).filter((item) => item.toLowerCase().includes("view this post on [liketu]") === false).filter((item) => item.toLowerCase().includes("[via Inbox]") === false).join("\n") : "").replace('Posted via <a href="https://d.buzz" data-link="promote-link">D.Buzz</a>', "").replace('<div class="pull-right"><a href="/@hive.engage"></a></div>', "").replace('<div><a href="https://engage.hivechain.app"></a></div>', "").replace(`<div class="text-center"><img src="https://cdn.steemitimages.com/DQmNp6YwAm2qwquALZw8PdcovDorwaBSFuxQ38TrYziGT6b/A-20.png"><a href="https://bit.ly/actifit-app"><img src="https://cdn.steemitimages.com/DQmQqfpSmcQtfrHAtzfBtVccXwUL9vKNgZJ2j93m8WNjizw/l5.png"></a><a href="https://bit.ly/actifit-ios"><img src="https://cdn.steemitimages.com/DQmbWy8KzKT1UvCvznUTaFPw6wBUcyLtBT5XL9wdbB7Hfmn/l6.png"></a></div>`, "");
|
|
1309
1306
|
}
|
|
1310
1307
|
var domSerializer = domSerializerModule__namespace.default || domSerializerModule__namespace;
|
|
1311
|
-
var
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1308
|
+
var lolightPromise = null;
|
|
1309
|
+
var lolightModule = null;
|
|
1310
|
+
async function loadLolight() {
|
|
1311
|
+
if (typeof window !== "undefined") {
|
|
1312
|
+
return null;
|
|
1313
|
+
}
|
|
1314
|
+
if (lolightModule) {
|
|
1315
|
+
return lolightModule;
|
|
1316
|
+
}
|
|
1317
|
+
if (!lolightPromise) {
|
|
1318
|
+
lolightPromise = import('lolight').then((mod) => {
|
|
1319
|
+
lolightModule = mod.default || mod;
|
|
1320
|
+
return lolightModule;
|
|
1321
|
+
}).catch(() => {
|
|
1322
|
+
lolightModule = null;
|
|
1317
1323
|
return null;
|
|
1318
|
-
}
|
|
1324
|
+
});
|
|
1319
1325
|
}
|
|
1320
|
-
return
|
|
1326
|
+
return lolightPromise;
|
|
1327
|
+
}
|
|
1328
|
+
function getLolightInstance() {
|
|
1329
|
+
return lolightModule;
|
|
1330
|
+
}
|
|
1331
|
+
if (typeof window === "undefined") {
|
|
1332
|
+
loadLolight().catch(() => {
|
|
1333
|
+
});
|
|
1321
1334
|
}
|
|
1322
1335
|
function fixBlockLevelTagsInParagraphs(html) {
|
|
1323
1336
|
const blockTags = "center|div|table|figure|section|article|aside|header|footer|nav|main";
|