1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 01:16:52 +02:00

fix: support text-only vnodes with extractText

Also seems to fix not having a space between 'Posts' and the number of posts in the UserPage tooltips
This commit is contained in:
David Sevilla Martin
2020-08-08 16:11:22 -04:00
committed by Franz Liedke
parent f897b58f29
commit 674f55e91d

View File

@@ -8,7 +8,7 @@ export default function extractText(vdom) {
if (vdom instanceof Array) {
return vdom.map((element) => extractText(element)).join('');
} else if (typeof vdom === 'object' && vdom !== null) {
return extractText(vdom.children);
return vdom.children ? extractText(vdom.children) : vdom.text;
} else {
return vdom;
}