if-else statement to be sure that the markdown library doesn't create issues with empty strings.
This commit is contained in:
@@ -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');
|
||||
}
|
||||
Reference in New Issue
Block a user