@ecency/render-helper 2.5.29 → 2.5.31
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 +22 -5
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +22 -5
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +22 -5
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
|
@@ -835,15 +835,31 @@ function img(el, state, forApp = true) {
|
|
|
835
835
|
return;
|
|
836
836
|
}
|
|
837
837
|
el.setAttribute("itemprop", "image");
|
|
838
|
-
const
|
|
839
|
-
|
|
838
|
+
const avatarRoute = new RegExp(`^${trimTrailingSlash(getProxyBase()).replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}/u/[^/]+/avatar(?:/[a-z]+)?$`);
|
|
839
|
+
const classTokens = (el.getAttribute("class") || "").split(/\s+/);
|
|
840
|
+
const isAvatar = avatarRoute.test(decodedSrc) || classTokens.includes("er-author-link-image");
|
|
841
|
+
if (isAvatar) {
|
|
842
|
+
el.setAttribute("loading", "lazy");
|
|
843
|
+
el.setAttribute("decoding", "async");
|
|
844
|
+
}
|
|
845
|
+
const imageIndex = !state || isAvatar ? 3 : state.imageCount ?? (state.firstImageFound ? 1 : 0);
|
|
846
|
+
if (state && !isAvatar) {
|
|
847
|
+
state.imageCount = imageIndex + 1;
|
|
848
|
+
state.firstImageFound = true;
|
|
849
|
+
}
|
|
850
|
+
if (isAvatar) ; else if (imageIndex === 0) {
|
|
840
851
|
el.setAttribute("loading", "eager");
|
|
841
852
|
el.setAttribute("fetchpriority", "high");
|
|
842
|
-
|
|
853
|
+
} else if (imageIndex === 1) {
|
|
854
|
+
el.setAttribute("loading", "eager");
|
|
855
|
+
el.setAttribute("decoding", "async");
|
|
843
856
|
} else {
|
|
844
857
|
el.setAttribute("loading", "lazy");
|
|
845
858
|
el.setAttribute("decoding", "async");
|
|
846
859
|
}
|
|
860
|
+
if (isAvatar || imageIndex !== 0) {
|
|
861
|
+
el.removeAttribute("fetchpriority");
|
|
862
|
+
}
|
|
847
863
|
const cls = el.getAttribute("class") || "";
|
|
848
864
|
const shouldReplace = !cls.includes("no-replace");
|
|
849
865
|
const base = trimTrailingSlash(getProxyBase());
|
|
@@ -1992,10 +2008,11 @@ function traverse(node, forApp, depth = 0, state = { firstImageFound: false }, p
|
|
|
1992
2008
|
|
|
1993
2009
|
// src/methods/clean-reply.method.ts
|
|
1994
2010
|
function cleanReply(s) {
|
|
1995
|
-
|
|
2011
|
+
const pre = s ? s.replace(/(^|\n)-{3,}[ \t]*\n+(?=[^\n]*originally posted through \[scrobble\.life)/i, "$1") : s;
|
|
2012
|
+
return (pre ? pre.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 via [first context") === 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) => {
|
|
1996
2013
|
const l = item.toLowerCase();
|
|
1997
2014
|
return !(l.includes("posted from liketu speak") && l.includes("auto-transcrib"));
|
|
1998
|
-
}).filter((item) => item.toLowerCase().includes("[via Inbox]") === false).filter((item) => item.toLowerCase().includes("<sub>[via apps from](") === 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>`, "");
|
|
2015
|
+
}).filter((item) => item.toLowerCase().includes("originally posted through [scrobble.life") === false).filter((item) => item.toLowerCase().includes("[via Inbox]") === false).filter((item) => item.toLowerCase().includes("<sub>[via apps from](") === 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>`, "");
|
|
1999
2016
|
}
|
|
2000
2017
|
var domSerializer = domSerializerModule.default || domSerializerModule;
|
|
2001
2018
|
var lolightPromise = null;
|