Skip to content

Commit

Permalink
fix: undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
nusr committed Jan 14, 2025
1 parent 826d855 commit 5915996
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function parseStyle(
styleMap: Record<string, CSSStyleDeclaration>,
style: CSSStyleDeclaration,
className: string,
tagName: string,
tagName: string = '',
): Partial<StyleType> {
let result: Partial<StyleType> = {};
const name = tagName.toLowerCase();
Expand Down Expand Up @@ -284,9 +284,9 @@ export function parseHTML(html: string) {
while (temp.nodeType !== Node.TEXT_NODE) {
const style = parseStyle(
styleMap,
temp.style,
temp.style || {},
temp.className ? `.${temp.className}` : '',
temp.tagName,
temp.tagName || '',
);
itemStyle = Object.assign(itemStyle, style);
if (temp.firstChild) {
Expand Down

0 comments on commit 5915996

Please sign in to comment.