mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
fix(markdown): make sure to only render strings, fix #11080
This commit is contained in:
@@ -269,7 +269,8 @@ export default {
|
|||||||
return highlightUsers(text, this.user.auth.local.username, this.user.profile.name);
|
return highlightUsers(text, this.user.auth.local.username, this.user.profile.name);
|
||||||
},
|
},
|
||||||
parseMarkdown (text) {
|
parseMarkdown (text) {
|
||||||
return habiticaMarkdown.render(text);
|
if (!text) return;
|
||||||
|
return habiticaMarkdown.render(String(text));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import habiticaMarkdown from 'habitica-markdown';
|
|||||||
export default function markdown (el, {value, oldValue}) {
|
export default function markdown (el, {value, oldValue}) {
|
||||||
if (value === oldValue) return;
|
if (value === oldValue) return;
|
||||||
|
|
||||||
el.innerHTML = habiticaMarkdown.render(value);
|
if (value) {
|
||||||
|
el.innerHTML = habiticaMarkdown.render(String(value));
|
||||||
|
}
|
||||||
el.classList.add('markdown');
|
el.classList.add('markdown');
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ export default {
|
|||||||
},
|
},
|
||||||
markdown (val) {
|
markdown (val) {
|
||||||
if (!val) return;
|
if (!val) return;
|
||||||
let parsedMarkdown = habiticaMarkdown.render(val);
|
let parsedMarkdown = habiticaMarkdown.render(String(val));
|
||||||
this.notify(parsedMarkdown, 'info');
|
this.notify(parsedMarkdown, 'info');
|
||||||
},
|
},
|
||||||
mp (val) {
|
mp (val) {
|
||||||
|
|||||||
Reference in New Issue
Block a user