Skip to content

Commit f85801a

Browse files
committed
fix?
1 parent 2812d4e commit f85801a

3 files changed

Lines changed: 15 additions & 11 deletions

File tree

dist/index.js

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,20 @@ const renderHTML = (mat: any) => {
116116
let body = "";
117117
let count = 0;
118118
for (const [key, val] of Object.entries(mat)) {
119+
let temp = "";
119120
if (Array.isArray(val)) {
120121
++count;
121-
body += `<th>${key}</th>`;
122+
temp += `<th>${key}</th>`;
122123
for (const elem of val) {
123-
body += `<td>${elem}</td>\n`;
124+
temp += `<td>${elem}</td>\n`;
124125
}
125-
body = `<tr>${body}</tr>`;
126+
temp = `<tr>${temp}</tr>`;
126127
} else {
127128
const { count: innerCount, body: innerBody } = renderHTML(val);
128-
body += `<th rowspan="${innerCount}">${key}</th>`;
129-
body += innerBody;
129+
temp += `<th rowspan="${innerCount}">${key}</th>`;
130+
temp += innerBody;
130131
}
132+
body += temp;
131133
}
132134
return { count, body };
133135
};

0 commit comments

Comments
 (0)