mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-23 23:03:01 +00:00
Compare commits
1 Commits
add-remove
...
ReworkHTML
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31c034c029 |
@@ -31,7 +31,12 @@ renderer.html = function (token) {
|
||||
const openTag = html.substring(0, html.indexOf('>')+1);
|
||||
html = html.substring(html.indexOf('>')+1);
|
||||
html = html.substring(0, html.lastIndexOf('</div>'));
|
||||
return `${openTag} ${Marked.parse(html)} </div>`;
|
||||
|
||||
// Repeat the markdown processing for content inside the div, minus the preprocessing and postprocessing hooks which should only run once globally
|
||||
const opts = Marked.defaults;
|
||||
const tokens = Marked.lexer(html, opts);
|
||||
Marked.walkTokens(tokens, opts.walkTokens);
|
||||
return `${openTag} ${Marked.parser(tokens, opts)} </div>`;
|
||||
}
|
||||
return html;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user