@ecency/render-helper 2.5.35 → 2.5.36
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 +4 -24
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +4 -24
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +4 -24
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.mjs
CHANGED
|
@@ -10255,10 +10255,6 @@ function markdown2Html(obj, forApp = true, _webp = false, parentDomain = "ecency
|
|
|
10255
10255
|
}
|
|
10256
10256
|
|
|
10257
10257
|
// src/catch-post-image.ts
|
|
10258
|
-
var gifLinkRegex = /\.(gif)$/i;
|
|
10259
|
-
function isGifLink(link) {
|
|
10260
|
-
return gifLinkRegex.test(link);
|
|
10261
|
-
}
|
|
10262
10258
|
var BACKTICK_FENCE_RE = /```[\s\S]*?```/g;
|
|
10263
10259
|
var TILDE_FENCE_RE = /~~~[\s\S]*?~~~/g;
|
|
10264
10260
|
var INLINE_CODE_RE = /`[^`\n]*`/g;
|
|
@@ -10763,11 +10759,7 @@ function firstMetaUrl(value) {
|
|
|
10763
10759
|
return void 0;
|
|
10764
10760
|
}
|
|
10765
10761
|
function proxifyFound(src, width, height, format) {
|
|
10766
|
-
|
|
10767
|
-
if (isGifLink(decoded)) {
|
|
10768
|
-
return proxifyImageSrc(decoded, 0, 0, format);
|
|
10769
|
-
}
|
|
10770
|
-
return proxifyImageSrc(decoded, width, height, format);
|
|
10762
|
+
return proxifyImageSrc(decodeEntities(src), width, height, format);
|
|
10771
10763
|
}
|
|
10772
10764
|
function getImage(entry, width = 0, height = 0, format = "match", fastMode = false) {
|
|
10773
10765
|
let meta;
|
|
@@ -10782,29 +10774,17 @@ function getImage(entry, width = 0, height = 0, format = "match", fastMode = fal
|
|
|
10782
10774
|
}
|
|
10783
10775
|
const thumbnail = firstMetaUrl(meta?.thumbnails);
|
|
10784
10776
|
if (thumbnail) {
|
|
10785
|
-
const
|
|
10786
|
-
const proxied = isGifLink(decodedThumbnail) ? proxifyImageSrc(decodedThumbnail, 0, 0, format) : proxifyImageSrc(decodedThumbnail, width, height, format);
|
|
10777
|
+
const proxied = proxifyImageSrc(decodeEntities(thumbnail), width, height, format);
|
|
10787
10778
|
if (proxied) {
|
|
10788
10779
|
return proxied;
|
|
10789
10780
|
}
|
|
10790
10781
|
}
|
|
10791
10782
|
if (meta && typeof meta.image === "string" && meta.image.length > 0) {
|
|
10792
|
-
|
|
10793
|
-
if (isGifLink(decodedImage)) {
|
|
10794
|
-
return proxifyImageSrc(decodedImage, 0, 0, format);
|
|
10795
|
-
}
|
|
10796
|
-
return proxifyImageSrc(decodedImage, width, height, format);
|
|
10783
|
+
return proxifyImageSrc(decodeEntities(meta.image), width, height, format);
|
|
10797
10784
|
}
|
|
10798
10785
|
if (meta && meta.image && !!meta.image.length && meta.image[0]) {
|
|
10799
10786
|
if (typeof meta.image[0] === "string") {
|
|
10800
|
-
|
|
10801
|
-
if (isGifLink(decodedImage)) {
|
|
10802
|
-
return proxifyImageSrc(decodedImage, 0, 0, format);
|
|
10803
|
-
}
|
|
10804
|
-
return proxifyImageSrc(decodedImage, width, height, format);
|
|
10805
|
-
}
|
|
10806
|
-
if (isGifLink(meta.image[0])) {
|
|
10807
|
-
return proxifyImageSrc(meta.image[0], 0, 0, format);
|
|
10787
|
+
return proxifyImageSrc(decodeEntities(meta.image[0]), width, height, format);
|
|
10808
10788
|
}
|
|
10809
10789
|
return proxifyImageSrc(meta.image[0], width, height, format);
|
|
10810
10790
|
}
|