@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/browser/index.js
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",
|
|
@@ -868,7 +861,7 @@ function a(el, forApp, webp, parentDomain = "ecency.com") {
|
|
|
868
861
|
const imgEls2 = el.getElementsByTagName("img");
|
|
869
862
|
if (imgEls2.length === 1 || el.textContent.trim() === href) {
|
|
870
863
|
if ((match[1] || match[2]) && match[3]) {
|
|
871
|
-
const videoHref = `https://3speak.tv/
|
|
864
|
+
const videoHref = `https://play.3speak.tv/watch?v=${match[3]}&mode=iframe`;
|
|
872
865
|
el.setAttribute("class", "markdown-video-link markdown-video-link-speak");
|
|
873
866
|
el.removeAttribute("href");
|
|
874
867
|
el.setAttribute("data-embed-src", videoHref);
|
|
@@ -1001,7 +994,11 @@ function iframe(el, parentDomain = "ecency.com") {
|
|
|
1001
994
|
return;
|
|
1002
995
|
}
|
|
1003
996
|
if (src.match(SPEAK_EMBED_REGEX)) {
|
|
1004
|
-
let normalizedSrc = src.replace(/3speak\.[a-z]+/i, "3speak.tv");
|
|
997
|
+
let normalizedSrc = src.replace(/3speak\.[a-z]+/i, "play.3speak.tv");
|
|
998
|
+
const hasMode = /[?&]mode=/.test(normalizedSrc);
|
|
999
|
+
if (!hasMode) {
|
|
1000
|
+
normalizedSrc = `${normalizedSrc}&mode=iframe`;
|
|
1001
|
+
}
|
|
1005
1002
|
const hasAutoplay = /[?&]autoplay=/.test(normalizedSrc);
|
|
1006
1003
|
const s = hasAutoplay ? normalizedSrc : `${normalizedSrc}&autoplay=true`;
|
|
1007
1004
|
el.setAttribute("src", s);
|
|
@@ -1276,16 +1273,32 @@ function cleanReply(s) {
|
|
|
1276
1273
|
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>`, "");
|
|
1277
1274
|
}
|
|
1278
1275
|
var domSerializer = domSerializerModule.default || domSerializerModule;
|
|
1279
|
-
var
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1276
|
+
var lolightPromise = null;
|
|
1277
|
+
var lolightModule = null;
|
|
1278
|
+
async function loadLolight() {
|
|
1279
|
+
if (typeof window !== "undefined") {
|
|
1280
|
+
return null;
|
|
1281
|
+
}
|
|
1282
|
+
if (lolightModule) {
|
|
1283
|
+
return lolightModule;
|
|
1284
|
+
}
|
|
1285
|
+
if (!lolightPromise) {
|
|
1286
|
+
lolightPromise = import('lolight').then((mod) => {
|
|
1287
|
+
lolightModule = mod.default || mod;
|
|
1288
|
+
return lolightModule;
|
|
1289
|
+
}).catch(() => {
|
|
1290
|
+
lolightModule = null;
|
|
1285
1291
|
return null;
|
|
1286
|
-
}
|
|
1292
|
+
});
|
|
1287
1293
|
}
|
|
1288
|
-
return
|
|
1294
|
+
return lolightPromise;
|
|
1295
|
+
}
|
|
1296
|
+
function getLolightInstance() {
|
|
1297
|
+
return lolightModule;
|
|
1298
|
+
}
|
|
1299
|
+
if (typeof window === "undefined") {
|
|
1300
|
+
loadLolight().catch(() => {
|
|
1301
|
+
});
|
|
1289
1302
|
}
|
|
1290
1303
|
function fixBlockLevelTagsInParagraphs(html) {
|
|
1291
1304
|
const blockTags = "center|div|table|figure|section|article|aside|header|footer|nav|main";
|