@ecency/render-helper 2.4.6 → 2.4.8

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.
@@ -9,13 +9,6 @@ import * as htmlparser2 from 'htmlparser2';
9
9
  import * as domSerializerModule from 'dom-serializer';
10
10
  import { LRUCache } from 'lru-cache';
11
11
 
12
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
13
- get: (a2, b) => (typeof require !== "undefined" ? require : a2)[b]
14
- }) : x)(function(x) {
15
- if (typeof require !== "undefined") return require.apply(this, arguments);
16
- throw Error('Dynamic require of "' + x + '" is not supported');
17
- });
18
-
19
12
  // src/consts/white-list.const.ts
20
13
  var WHITE_LIST = [
21
14
  "ecency.com",
@@ -392,6 +385,12 @@ var getInlineMeta = (el, href) => {
392
385
  isInline: textMatches || titleMatches
393
386
  };
394
387
  };
388
+ var addLineBreakBeforePostLink = (el, forApp, isInline) => {
389
+ if (forApp && isInline && el.parentNode) {
390
+ const br = el.ownerDocument.createElement("br");
391
+ el.parentNode.insertBefore(br, el);
392
+ }
393
+ };
395
394
  function a(el, forApp, webp, parentDomain = "ecency.com") {
396
395
  if (!el || !el.parentNode) {
397
396
  return;
@@ -455,6 +454,7 @@ function a(el, forApp, webp, parentDomain = "ecency.com") {
455
454
  el.setAttribute("href", h);
456
455
  el.setAttribute("data-is-inline", "" + isInline);
457
456
  }
457
+ addLineBreakBeforePostLink(el, forApp, isInline);
458
458
  return;
459
459
  }
460
460
  const mentionMatch = href.match(MENTION_REGEX);
@@ -532,6 +532,7 @@ function a(el, forApp, webp, parentDomain = "ecency.com") {
532
532
  el.setAttribute("href", h);
533
533
  el.setAttribute("data-is-inline", "" + isInline);
534
534
  }
535
+ addLineBreakBeforePostLink(el, forApp, isInline);
535
536
  return;
536
537
  }
537
538
  }
@@ -596,6 +597,7 @@ function a(el, forApp, webp, parentDomain = "ecency.com") {
596
597
  el.setAttribute("href", h);
597
598
  el.setAttribute("data-is-inline", "" + isInline);
598
599
  }
600
+ addLineBreakBeforePostLink(el, forApp, isInline);
599
601
  return;
600
602
  }
601
603
  }
@@ -681,6 +683,7 @@ function a(el, forApp, webp, parentDomain = "ecency.com") {
681
683
  el.setAttribute("href", h);
682
684
  el.setAttribute("data-is-inline", "" + isInline);
683
685
  }
686
+ addLineBreakBeforePostLink(el, forApp, isInline);
684
687
  return;
685
688
  }
686
689
  const BCmatch = href.match(BITCHUTE_REGEX);
@@ -1266,16 +1269,32 @@ function cleanReply(s) {
1266
1269
  return (s ? s.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 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) => item.toLowerCase().includes("[via Inbox]") === 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">![](https://i.imgur.com/XsrNmcl.png)</a></div>', "").replace('<div><a href="https://engage.hivechain.app">![](https://i.imgur.com/XsrNmcl.png)</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>`, "");
1267
1270
  }
1268
1271
  var domSerializer = domSerializerModule.default || domSerializerModule;
1269
- var lolight = null;
1270
- function getLolightInstance() {
1271
- if (!lolight) {
1272
- try {
1273
- lolight = __require("lolight");
1274
- } catch (e) {
1272
+ var lolightPromise = null;
1273
+ var lolightModule = null;
1274
+ async function loadLolight() {
1275
+ if (typeof window !== "undefined") {
1276
+ return null;
1277
+ }
1278
+ if (lolightModule) {
1279
+ return lolightModule;
1280
+ }
1281
+ if (!lolightPromise) {
1282
+ lolightPromise = import('lolight').then((mod) => {
1283
+ lolightModule = mod.default || mod;
1284
+ return lolightModule;
1285
+ }).catch(() => {
1286
+ lolightModule = null;
1275
1287
  return null;
1276
- }
1288
+ });
1277
1289
  }
1278
- return lolight;
1290
+ return lolightPromise;
1291
+ }
1292
+ function getLolightInstance() {
1293
+ return lolightModule;
1294
+ }
1295
+ if (typeof window === "undefined") {
1296
+ loadLolight().catch(() => {
1297
+ });
1279
1298
  }
1280
1299
  function fixBlockLevelTagsInParagraphs(html) {
1281
1300
  const blockTags = "center|div|table|figure|section|article|aside|header|footer|nav|main";