@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/node/index.mjs
CHANGED
|
@@ -833,15 +833,31 @@ function img(el, state, forApp = true) {
|
|
|
833
833
|
return;
|
|
834
834
|
}
|
|
835
835
|
el.setAttribute("itemprop", "image");
|
|
836
|
-
const
|
|
837
|
-
|
|
836
|
+
const avatarRoute = new RegExp(`^${trimTrailingSlash(getProxyBase()).replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}/u/[^/]+/avatar(?:/[a-z]+)?$`);
|
|
837
|
+
const classTokens = (el.getAttribute("class") || "").split(/\s+/);
|
|
838
|
+
const isAvatar = avatarRoute.test(decodedSrc) || classTokens.includes("er-author-link-image");
|
|
839
|
+
if (isAvatar) {
|
|
840
|
+
el.setAttribute("loading", "lazy");
|
|
841
|
+
el.setAttribute("decoding", "async");
|
|
842
|
+
}
|
|
843
|
+
const imageIndex = !state || isAvatar ? 3 : state.imageCount ?? (state.firstImageFound ? 1 : 0);
|
|
844
|
+
if (state && !isAvatar) {
|
|
845
|
+
state.imageCount = imageIndex + 1;
|
|
846
|
+
state.firstImageFound = true;
|
|
847
|
+
}
|
|
848
|
+
if (isAvatar) ; else if (imageIndex === 0) {
|
|
838
849
|
el.setAttribute("loading", "eager");
|
|
839
850
|
el.setAttribute("fetchpriority", "high");
|
|
840
|
-
|
|
851
|
+
} else if (imageIndex === 1) {
|
|
852
|
+
el.setAttribute("loading", "eager");
|
|
853
|
+
el.setAttribute("decoding", "async");
|
|
841
854
|
} else {
|
|
842
855
|
el.setAttribute("loading", "lazy");
|
|
843
856
|
el.setAttribute("decoding", "async");
|
|
844
857
|
}
|
|
858
|
+
if (isAvatar || imageIndex !== 0) {
|
|
859
|
+
el.removeAttribute("fetchpriority");
|
|
860
|
+
}
|
|
845
861
|
const cls = el.getAttribute("class") || "";
|
|
846
862
|
const shouldReplace = !cls.includes("no-replace");
|
|
847
863
|
const base = trimTrailingSlash(getProxyBase());
|
|
@@ -1990,10 +2006,11 @@ function traverse(node, forApp, depth = 0, state = { firstImageFound: false }, p
|
|
|
1990
2006
|
|
|
1991
2007
|
// src/methods/clean-reply.method.ts
|
|
1992
2008
|
function cleanReply(s) {
|
|
1993
|
-
|
|
2009
|
+
const pre = s ? s.replace(/(^|\n)-{3,}[ \t]*\n+(?=[^\n]*originally posted through \[scrobble\.life)/i, "$1") : s;
|
|
2010
|
+
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) => {
|
|
1994
2011
|
const l = item.toLowerCase();
|
|
1995
2012
|
return !(l.includes("posted from liketu speak") && l.includes("auto-transcrib"));
|
|
1996
|
-
}).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>`, "");
|
|
2013
|
+
}).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>`, "");
|
|
1997
2014
|
}
|
|
1998
2015
|
|
|
1999
2016
|
// ../../node_modules/.pnpm/remarkable@2.0.1/node_modules/remarkable/dist/esm/index.js
|