@ecency/render-helper 2.4.27 → 2.4.28

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.
@@ -1583,6 +1583,22 @@ function markdownToHTML(input, forApp, parentDomain = "ecency.com", seoContext,
1583
1583
  output = output.replace(/ xmlns="http:\/\/www.w3.org\/1999\/xhtml"/g, "").replace('<body id="root">', "").replace("</body>", "").trim();
1584
1584
  return sanitizeHtml(output);
1585
1585
  }
1586
+ var mdInstance = null;
1587
+ function getMd() {
1588
+ if (!mdInstance) {
1589
+ mdInstance = new remarkable.Remarkable({
1590
+ html: true,
1591
+ breaks: true,
1592
+ typographer: false
1593
+ }).use(linkify$1.linkify);
1594
+ }
1595
+ return mdInstance;
1596
+ }
1597
+ function simpleMarkdownToHTML(input) {
1598
+ if (!input) return "";
1599
+ const html = getMd().render(input);
1600
+ return sanitizeHtml(html);
1601
+ }
1586
1602
  var cache = new lruCache.LRUCache({ max: 60 });
1587
1603
  function setCacheSize(size) {
1588
1604
  cache = new lruCache.LRUCache({ max: size });
@@ -1798,5 +1814,6 @@ exports.proxifyImageSrc = proxifyImageSrc;
1798
1814
  exports.renderPostBody = markdown2Html;
1799
1815
  exports.setCacheSize = setCacheSize;
1800
1816
  exports.setProxyBase = setProxyBase;
1817
+ exports.simpleMarkdownToHTML = simpleMarkdownToHTML;
1801
1818
  //# sourceMappingURL=index.cjs.map
1802
1819
  //# sourceMappingURL=index.cjs.map