mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-19 12:18:51 +00:00
if-else statement to be sure that the markdown library doesn't create issues with empty strings.
This commit is contained in:
parent
feb98a5ac7
commit
bda3fb5f4d
1 changed files with 4 additions and 1 deletions
|
|
@ -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');
|
||||
}
|
||||
Loading…
Reference in a new issue