From bda3fb5f4d15fc1009fab409dbf0a235baafb0e2 Mon Sep 17 00:00:00 2001 From: Jose Garay Date: Wed, 15 May 2019 08:10:44 -0700 Subject: [PATCH] if-else statement to be sure that the markdown library doesn't create issues with empty strings. --- website/client/directives/markdown.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/website/client/directives/markdown.js b/website/client/directives/markdown.js index 2f892675af..bc2cd0a458 100644 --- a/website/client/directives/markdown.js +++ b/website/client/directives/markdown.js @@ -3,8 +3,11 @@ import habiticaMarkdown from 'habitica-markdown'; export default function markdown (el, {value, oldValue}) { if (value === oldValue) return; - if (value || value === '') { + if (value) { el.innerHTML = habiticaMarkdown.render(String(value)); + } else { + el.innerHTML = ''; } + el.classList.add('markdown'); } \ No newline at end of file