Markdown display fixes + error pages

This commit is contained in:
NGPixel
2016-12-05 21:42:41 -05:00
parent f7ce81e8c9
commit 593481c7e1
11 changed files with 48 additions and 26 deletions

View File

@@ -55,7 +55,7 @@ var mkdown = md({
// Rendering rules
mkdown.renderer.rules.emoji = function(token, idx) {
return '<i class="twa twa-' + token[idx].markup + '"></i>';
return '<i class="twa twa-' + _.replace(token[idx].markup, /_/g, '-') + '"></i>';
};
/**
@@ -171,6 +171,19 @@ const parseContent = (content) => {
cr(elm).replaceWith(txtLink);
});
//-> Re-attach blockquote styling classes to their parents
cr.root().children('blockquote').each((i, elm) => {
if(cr(elm).children().length > 0) {
let bqLastChild = cr(elm).children().last()[0];
let bqLastChildClasses = cr(bqLastChild).attr('class');
if(bqLastChildClasses.length > 0) {
cr(bqLastChild).removeAttr('class');
cr(elm).addClass(bqLastChildClasses);
}
}
});
output = cr.html();
return output;