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:
committed by
Franz Liedke
parent
f897b58f29
commit
674f55e91d
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user