mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-19 03:22:45 +00:00
Short term fix for the colons in codeblocks issue.
This commit is contained in:
@@ -69,6 +69,20 @@ renderer.html = function (html) {
|
|||||||
return html;
|
return html;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
renderer.code = function(code, infostring, escaped) {
|
||||||
|
const lang = (infostring || '').match(/^\S*/)?.[0];
|
||||||
|
|
||||||
|
code = code.replace(/<div class='blank'><\/div>/gm, (match)=>`${`:`}`);
|
||||||
|
|
||||||
|
code = `${code.replace(/\n$/, '')}\n`;
|
||||||
|
|
||||||
|
if(!lang) {
|
||||||
|
return `<pre><code>${escaped ? code : escape(code, true)}</code></pre>\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return `<pre><code class="language-${escape(lang)}">${escaped ? code : escape(code, true)}</code></pre>\n`;
|
||||||
|
};
|
||||||
|
|
||||||
// Don't wrap {{ Spans alone on a line, or {{ Divs in <p> tags
|
// Don't wrap {{ Spans alone on a line, or {{ Divs in <p> tags
|
||||||
renderer.paragraph = function(text){
|
renderer.paragraph = function(text){
|
||||||
let match;
|
let match;
|
||||||
|
|||||||
Reference in New Issue
Block a user