@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.
- package/dist/browser/index.d.ts +11 -1
- package/dist/browser/index.js +17 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +17 -0
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +17 -1
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.mjs
CHANGED
|
@@ -1554,6 +1554,22 @@ function markdownToHTML(input, forApp, parentDomain = "ecency.com", seoContext,
|
|
|
1554
1554
|
output = output.replace(/ xmlns="http:\/\/www.w3.org\/1999\/xhtml"/g, "").replace('<body id="root">', "").replace("</body>", "").trim();
|
|
1555
1555
|
return sanitizeHtml(output);
|
|
1556
1556
|
}
|
|
1557
|
+
var mdInstance = null;
|
|
1558
|
+
function getMd() {
|
|
1559
|
+
if (!mdInstance) {
|
|
1560
|
+
mdInstance = new Remarkable({
|
|
1561
|
+
html: true,
|
|
1562
|
+
breaks: true,
|
|
1563
|
+
typographer: false
|
|
1564
|
+
}).use(linkify$1);
|
|
1565
|
+
}
|
|
1566
|
+
return mdInstance;
|
|
1567
|
+
}
|
|
1568
|
+
function simpleMarkdownToHTML(input) {
|
|
1569
|
+
if (!input) return "";
|
|
1570
|
+
const html = getMd().render(input);
|
|
1571
|
+
return sanitizeHtml(html);
|
|
1572
|
+
}
|
|
1557
1573
|
var cache = new LRUCache({ max: 60 });
|
|
1558
1574
|
function setCacheSize(size) {
|
|
1559
1575
|
cache = new LRUCache({ max: size });
|
|
@@ -1761,6 +1777,6 @@ function getPostBodySummary(obj, length, platform) {
|
|
|
1761
1777
|
return res;
|
|
1762
1778
|
}
|
|
1763
1779
|
|
|
1764
|
-
export { SECTION_LIST, catchPostImage, isValidPermlink, getPostBodySummary as postBodySummary, proxifyImageSrc, markdown2Html as renderPostBody, setCacheSize, setProxyBase };
|
|
1780
|
+
export { SECTION_LIST, catchPostImage, isValidPermlink, getPostBodySummary as postBodySummary, proxifyImageSrc, markdown2Html as renderPostBody, setCacheSize, setProxyBase, simpleMarkdownToHTML };
|
|
1765
1781
|
//# sourceMappingURL=index.mjs.map
|
|
1766
1782
|
//# sourceMappingURL=index.mjs.map
|