0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-15 04:02:38 +00:00

Move renderer assignment to options

This commit is contained in:
G.Ambatte
2023-02-21 07:42:38 +13:00
parent 9eb8653dfb
commit f528b55226

View File

@@ -10,7 +10,7 @@ renderer.html = function (html) {
const openTag = html.substring(0, html.indexOf('>')+1); const openTag = html.substring(0, html.indexOf('>')+1);
html = html.substring(html.indexOf('>')+1); html = html.substring(html.indexOf('>')+1);
html = html.substring(0, html.lastIndexOf('</div>')); html = html.substring(0, html.lastIndexOf('</div>'));
return `${openTag} ${Marked.parse(html, { renderer: renderer })} </div>`; return `${openTag} ${Marked.parse(html)} </div>`;
} }
return html; return html;
}; };
@@ -239,7 +239,7 @@ const definitionLists = {
Marked.use({ extensions: [mustacheSpans, mustacheDivs, mustacheInjectInline, definitionLists] }); Marked.use({ extensions: [mustacheSpans, mustacheDivs, mustacheInjectInline, definitionLists] });
Marked.use(MarkedExtendedTables()); Marked.use(MarkedExtendedTables());
Marked.use(mustacheInjectBlock); Marked.use(mustacheInjectBlock);
Marked.use({ smartypants: true }); Marked.use({ renderer: renderer, smartypants: true });
//Fix local links in the Preview iFrame to link inside the frame //Fix local links in the Preview iFrame to link inside the frame
renderer.link = function (href, title, text) { renderer.link = function (href, title, text) {