@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.mjs
CHANGED
|
@@ -9,13 +9,6 @@ import * as htmlparser2 from 'htmlparser2';
|
|
|
9
9
|
import * as domSerializerModule from 'dom-serializer';
|
|
10
10
|
import { LRUCache } from 'lru-cache';
|
|
11
11
|
|
|
12
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
13
|
-
get: (a2, b) => (typeof require !== "undefined" ? require : a2)[b]
|
|
14
|
-
}) : x)(function(x) {
|
|
15
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
16
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
17
|
-
});
|
|
18
|
-
|
|
19
12
|
// src/consts/white-list.const.ts
|
|
20
13
|
var WHITE_LIST = [
|
|
21
14
|
"ecency.com",
|
|
@@ -871,7 +864,7 @@ function a(el, forApp, webp, parentDomain = "ecency.com") {
|
|
|
871
864
|
const imgEls2 = el.getElementsByTagName("img");
|
|
872
865
|
if (imgEls2.length === 1 || el.textContent.trim() === href) {
|
|
873
866
|
if ((match[1] || match[2]) && match[3]) {
|
|
874
|
-
const videoHref = `https://3speak.tv/
|
|
867
|
+
const videoHref = `https://play.3speak.tv/watch?v=${match[3]}&mode=iframe`;
|
|
875
868
|
el.setAttribute("class", "markdown-video-link markdown-video-link-speak");
|
|
876
869
|
el.removeAttribute("href");
|
|
877
870
|
el.setAttribute("data-embed-src", videoHref);
|
|
@@ -1004,7 +997,11 @@ function iframe(el, parentDomain = "ecency.com") {
|
|
|
1004
997
|
return;
|
|
1005
998
|
}
|
|
1006
999
|
if (src.match(SPEAK_EMBED_REGEX)) {
|
|
1007
|
-
let normalizedSrc = src.replace(/3speak\.[a-z]+/i, "3speak.tv");
|
|
1000
|
+
let normalizedSrc = src.replace(/3speak\.[a-z]+/i, "play.3speak.tv");
|
|
1001
|
+
const hasMode = /[?&]mode=/.test(normalizedSrc);
|
|
1002
|
+
if (!hasMode) {
|
|
1003
|
+
normalizedSrc = `${normalizedSrc}&mode=iframe`;
|
|
1004
|
+
}
|
|
1008
1005
|
const hasAutoplay = /[?&]autoplay=/.test(normalizedSrc);
|
|
1009
1006
|
const s = hasAutoplay ? normalizedSrc : `${normalizedSrc}&autoplay=true`;
|
|
1010
1007
|
el.setAttribute("src", s);
|
|
@@ -1279,16 +1276,32 @@ function cleanReply(s) {
|
|
|
1279
1276
|
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>`, "");
|
|
1280
1277
|
}
|
|
1281
1278
|
var domSerializer = domSerializerModule.default || domSerializerModule;
|
|
1282
|
-
var
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1279
|
+
var lolightPromise = null;
|
|
1280
|
+
var lolightModule = null;
|
|
1281
|
+
async function loadLolight() {
|
|
1282
|
+
if (typeof window !== "undefined") {
|
|
1283
|
+
return null;
|
|
1284
|
+
}
|
|
1285
|
+
if (lolightModule) {
|
|
1286
|
+
return lolightModule;
|
|
1287
|
+
}
|
|
1288
|
+
if (!lolightPromise) {
|
|
1289
|
+
lolightPromise = import('lolight').then((mod) => {
|
|
1290
|
+
lolightModule = mod.default || mod;
|
|
1291
|
+
return lolightModule;
|
|
1292
|
+
}).catch(() => {
|
|
1293
|
+
lolightModule = null;
|
|
1288
1294
|
return null;
|
|
1289
|
-
}
|
|
1295
|
+
});
|
|
1290
1296
|
}
|
|
1291
|
-
return
|
|
1297
|
+
return lolightPromise;
|
|
1298
|
+
}
|
|
1299
|
+
function getLolightInstance() {
|
|
1300
|
+
return lolightModule;
|
|
1301
|
+
}
|
|
1302
|
+
if (typeof window === "undefined") {
|
|
1303
|
+
loadLolight().catch(() => {
|
|
1304
|
+
});
|
|
1292
1305
|
}
|
|
1293
1306
|
function fixBlockLevelTagsInParagraphs(html) {
|
|
1294
1307
|
const blockTags = "center|div|table|figure|section|article|aside|header|footer|nav|main";
|