@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.cjs
CHANGED
|
@@ -860,15 +860,31 @@ function img(el, state, forApp = true) {
|
|
|
860
860
|
return;
|
|
861
861
|
}
|
|
862
862
|
el.setAttribute("itemprop", "image");
|
|
863
|
-
const
|
|
864
|
-
|
|
863
|
+
const avatarRoute = new RegExp(`^${trimTrailingSlash(getProxyBase()).replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}/u/[^/]+/avatar(?:/[a-z]+)?$`);
|
|
864
|
+
const classTokens = (el.getAttribute("class") || "").split(/\s+/);
|
|
865
|
+
const isAvatar = avatarRoute.test(decodedSrc) || classTokens.includes("er-author-link-image");
|
|
866
|
+
if (isAvatar) {
|
|
867
|
+
el.setAttribute("loading", "lazy");
|
|
868
|
+
el.setAttribute("decoding", "async");
|
|
869
|
+
}
|
|
870
|
+
const imageIndex = !state || isAvatar ? 3 : state.imageCount ?? (state.firstImageFound ? 1 : 0);
|
|
871
|
+
if (state && !isAvatar) {
|
|
872
|
+
state.imageCount = imageIndex + 1;
|
|
873
|
+
state.firstImageFound = true;
|
|
874
|
+
}
|
|
875
|
+
if (isAvatar) ; else if (imageIndex === 0) {
|
|
865
876
|
el.setAttribute("loading", "eager");
|
|
866
877
|
el.setAttribute("fetchpriority", "high");
|
|
867
|
-
|
|
878
|
+
} else if (imageIndex === 1) {
|
|
879
|
+
el.setAttribute("loading", "eager");
|
|
880
|
+
el.setAttribute("decoding", "async");
|
|
868
881
|
} else {
|
|
869
882
|
el.setAttribute("loading", "lazy");
|
|
870
883
|
el.setAttribute("decoding", "async");
|
|
871
884
|
}
|
|
885
|
+
if (isAvatar || imageIndex !== 0) {
|
|
886
|
+
el.removeAttribute("fetchpriority");
|
|
887
|
+
}
|
|
872
888
|
const cls = el.getAttribute("class") || "";
|
|
873
889
|
const shouldReplace = !cls.includes("no-replace");
|
|
874
890
|
const base = trimTrailingSlash(getProxyBase());
|
|
@@ -2017,10 +2033,11 @@ function traverse(node, forApp, depth = 0, state = { firstImageFound: false }, p
|
|
|
2017
2033
|
|
|
2018
2034
|
// src/methods/clean-reply.method.ts
|
|
2019
2035
|
function cleanReply(s) {
|
|
2020
|
-
|
|
2036
|
+
const pre = s ? s.replace(/(^|\n)-{3,}[ \t]*\n+(?=[^\n]*originally posted through \[scrobble\.life)/i, "$1") : s;
|
|
2037
|
+
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) => {
|
|
2021
2038
|
const l = item.toLowerCase();
|
|
2022
2039
|
return !(l.includes("posted from liketu speak") && l.includes("auto-transcrib"));
|
|
2023
|
-
}).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>`, "");
|
|
2040
|
+
}).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>`, "");
|
|
2024
2041
|
}
|
|
2025
2042
|
|
|
2026
2043
|
// ../../node_modules/.pnpm/remarkable@2.0.1/node_modules/remarkable/dist/esm/index.js
|