@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/browser/index.js
CHANGED
|
@@ -2210,10 +2210,6 @@ function markdown2Html(obj, forApp = true, _webp = false, parentDomain = "ecency
|
|
|
2210
2210
|
}
|
|
2211
2211
|
|
|
2212
2212
|
// src/catch-post-image.ts
|
|
2213
|
-
var gifLinkRegex = /\.(gif)$/i;
|
|
2214
|
-
function isGifLink(link) {
|
|
2215
|
-
return gifLinkRegex.test(link);
|
|
2216
|
-
}
|
|
2217
2213
|
var BACKTICK_FENCE_RE = /```[\s\S]*?```/g;
|
|
2218
2214
|
var TILDE_FENCE_RE = /~~~[\s\S]*?~~~/g;
|
|
2219
2215
|
var INLINE_CODE_RE = /`[^`\n]*`/g;
|
|
@@ -2718,11 +2714,7 @@ function firstMetaUrl(value) {
|
|
|
2718
2714
|
return void 0;
|
|
2719
2715
|
}
|
|
2720
2716
|
function proxifyFound(src, width, height, format) {
|
|
2721
|
-
|
|
2722
|
-
if (isGifLink(decoded)) {
|
|
2723
|
-
return proxifyImageSrc(decoded, 0, 0, format);
|
|
2724
|
-
}
|
|
2725
|
-
return proxifyImageSrc(decoded, width, height, format);
|
|
2717
|
+
return proxifyImageSrc(decodeEntities(src), width, height, format);
|
|
2726
2718
|
}
|
|
2727
2719
|
function getImage(entry, width = 0, height = 0, format = "match", fastMode = false) {
|
|
2728
2720
|
let meta;
|
|
@@ -2737,29 +2729,17 @@ function getImage(entry, width = 0, height = 0, format = "match", fastMode = fal
|
|
|
2737
2729
|
}
|
|
2738
2730
|
const thumbnail = firstMetaUrl(meta?.thumbnails);
|
|
2739
2731
|
if (thumbnail) {
|
|
2740
|
-
const
|
|
2741
|
-
const proxied = isGifLink(decodedThumbnail) ? proxifyImageSrc(decodedThumbnail, 0, 0, format) : proxifyImageSrc(decodedThumbnail, width, height, format);
|
|
2732
|
+
const proxied = proxifyImageSrc(decodeEntities(thumbnail), width, height, format);
|
|
2742
2733
|
if (proxied) {
|
|
2743
2734
|
return proxied;
|
|
2744
2735
|
}
|
|
2745
2736
|
}
|
|
2746
2737
|
if (meta && typeof meta.image === "string" && meta.image.length > 0) {
|
|
2747
|
-
|
|
2748
|
-
if (isGifLink(decodedImage)) {
|
|
2749
|
-
return proxifyImageSrc(decodedImage, 0, 0, format);
|
|
2750
|
-
}
|
|
2751
|
-
return proxifyImageSrc(decodedImage, width, height, format);
|
|
2738
|
+
return proxifyImageSrc(decodeEntities(meta.image), width, height, format);
|
|
2752
2739
|
}
|
|
2753
2740
|
if (meta && meta.image && !!meta.image.length && meta.image[0]) {
|
|
2754
2741
|
if (typeof meta.image[0] === "string") {
|
|
2755
|
-
|
|
2756
|
-
if (isGifLink(decodedImage)) {
|
|
2757
|
-
return proxifyImageSrc(decodedImage, 0, 0, format);
|
|
2758
|
-
}
|
|
2759
|
-
return proxifyImageSrc(decodedImage, width, height, format);
|
|
2760
|
-
}
|
|
2761
|
-
if (isGifLink(meta.image[0])) {
|
|
2762
|
-
return proxifyImageSrc(meta.image[0], 0, 0, format);
|
|
2742
|
+
return proxifyImageSrc(decodeEntities(meta.image[0]), width, height, format);
|
|
2763
2743
|
}
|
|
2764
2744
|
return proxifyImageSrc(meta.image[0], width, height, format);
|
|
2765
2745
|
}
|