From 6a1844cac70337f4705a707ce5a8e4edc73c2b88 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 8 Jul 2020 13:37:21 -0400 Subject: [PATCH] avoid passing whitespace to markmap or mathjax --- www/common/diffMarked.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/common/diffMarked.js b/www/common/diffMarked.js index efe22285a..1433a2381 100644 --- a/www/common/diffMarked.js +++ b/www/common/diffMarked.js @@ -191,6 +191,7 @@ define([ var defaultCode = renderer.code; renderer.code = function (code, language) { + if (!code || typeof(code) !== 'string' || !code.trim()) { return defaultCode.apply(renderer, arguments); } if (language === 'mermaid' && code.match(/^(graph|pie|gantt|sequenceDiagram|classDiagram|gitGraph)/)) { return '
'+Util.fixHTML(code)+'
'; } else if (language === 'markmap') {