Skip to content

Commit af9d828

Browse files
committed
fix: empty and false content, close #58
1 parent d019534 commit af9d828

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ function render(tree?: Node | Node[], options: Options = {}): string {
7575
for (const node of tree) {
7676
// Undefined, null, '', [], NaN
7777
if (
78+
node === false ||
7879
node === undefined ||
7980
node === null ||
8081
(typeof node === 'string' && node.length === 0) ||
@@ -91,7 +92,7 @@ function render(tree?: Node | Node[], options: Options = {}): string {
9192

9293
result += html(node);
9394

94-
break;
95+
continue;
9596
}
9697

9798
if (typeof node === 'string' || typeof node === 'number') {
@@ -111,7 +112,7 @@ function render(tree?: Node | Node[], options: Options = {}): string {
111112
if (node.tag === false) {
112113
result += html(node.content);
113114

114-
break;
115+
continue;
115116
}
116117

117118
const tag = typeof node.tag === 'string' ? node.tag : 'div';

0 commit comments

Comments
 (0)