@ecency/render-helper 2.4.6 → 2.4.8
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 +34 -15
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +34 -15
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +34 -15
- 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",
|
|
@@ -424,6 +417,12 @@ var getInlineMeta = (el, href) => {
|
|
|
424
417
|
isInline: textMatches || titleMatches
|
|
425
418
|
};
|
|
426
419
|
};
|
|
420
|
+
var addLineBreakBeforePostLink = (el, forApp, isInline) => {
|
|
421
|
+
if (forApp && isInline && el.parentNode) {
|
|
422
|
+
const br = el.ownerDocument.createElement("br");
|
|
423
|
+
el.parentNode.insertBefore(br, el);
|
|
424
|
+
}
|
|
425
|
+
};
|
|
427
426
|
function a(el, forApp, webp, parentDomain = "ecency.com") {
|
|
428
427
|
if (!el || !el.parentNode) {
|
|
429
428
|
return;
|
|
@@ -487,6 +486,7 @@ function a(el, forApp, webp, parentDomain = "ecency.com") {
|
|
|
487
486
|
el.setAttribute("href", h);
|
|
488
487
|
el.setAttribute("data-is-inline", "" + isInline);
|
|
489
488
|
}
|
|
489
|
+
addLineBreakBeforePostLink(el, forApp, isInline);
|
|
490
490
|
return;
|
|
491
491
|
}
|
|
492
492
|
const mentionMatch = href.match(MENTION_REGEX);
|
|
@@ -564,6 +564,7 @@ function a(el, forApp, webp, parentDomain = "ecency.com") {
|
|
|
564
564
|
el.setAttribute("href", h);
|
|
565
565
|
el.setAttribute("data-is-inline", "" + isInline);
|
|
566
566
|
}
|
|
567
|
+
addLineBreakBeforePostLink(el, forApp, isInline);
|
|
567
568
|
return;
|
|
568
569
|
}
|
|
569
570
|
}
|
|
@@ -628,6 +629,7 @@ function a(el, forApp, webp, parentDomain = "ecency.com") {
|
|
|
628
629
|
el.setAttribute("href", h);
|
|
629
630
|
el.setAttribute("data-is-inline", "" + isInline);
|
|
630
631
|
}
|
|
632
|
+
addLineBreakBeforePostLink(el, forApp, isInline);
|
|
631
633
|
return;
|
|
632
634
|
}
|
|
633
635
|
}
|
|
@@ -713,6 +715,7 @@ function a(el, forApp, webp, parentDomain = "ecency.com") {
|
|
|
713
715
|
el.setAttribute("href", h);
|
|
714
716
|
el.setAttribute("data-is-inline", "" + isInline);
|
|
715
717
|
}
|
|
718
|
+
addLineBreakBeforePostLink(el, forApp, isInline);
|
|
716
719
|
return;
|
|
717
720
|
}
|
|
718
721
|
const BCmatch = href.match(BITCHUTE_REGEX);
|
|
@@ -1298,16 +1301,32 @@ function cleanReply(s) {
|
|
|
1298
1301
|
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>`, "");
|
|
1299
1302
|
}
|
|
1300
1303
|
var domSerializer = domSerializerModule__namespace.default || domSerializerModule__namespace;
|
|
1301
|
-
var
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1304
|
+
var lolightPromise = null;
|
|
1305
|
+
var lolightModule = null;
|
|
1306
|
+
async function loadLolight() {
|
|
1307
|
+
if (typeof window !== "undefined") {
|
|
1308
|
+
return null;
|
|
1309
|
+
}
|
|
1310
|
+
if (lolightModule) {
|
|
1311
|
+
return lolightModule;
|
|
1312
|
+
}
|
|
1313
|
+
if (!lolightPromise) {
|
|
1314
|
+
lolightPromise = import('lolight').then((mod) => {
|
|
1315
|
+
lolightModule = mod.default || mod;
|
|
1316
|
+
return lolightModule;
|
|
1317
|
+
}).catch(() => {
|
|
1318
|
+
lolightModule = null;
|
|
1307
1319
|
return null;
|
|
1308
|
-
}
|
|
1320
|
+
});
|
|
1309
1321
|
}
|
|
1310
|
-
return
|
|
1322
|
+
return lolightPromise;
|
|
1323
|
+
}
|
|
1324
|
+
function getLolightInstance() {
|
|
1325
|
+
return lolightModule;
|
|
1326
|
+
}
|
|
1327
|
+
if (typeof window === "undefined") {
|
|
1328
|
+
loadLolight().catch(() => {
|
|
1329
|
+
});
|
|
1311
1330
|
}
|
|
1312
1331
|
function fixBlockLevelTagsInParagraphs(html) {
|
|
1313
1332
|
const blockTags = "center|div|table|figure|section|article|aside|header|footer|nav|main";
|