Markdown display fixes + error pages
This commit is contained in:
		| @@ -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; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user