Skip to content

Commit 3549e1c

Browse files
committed
guard null attribute value before escapeHtml
1 parent ca14a07 commit 3549e1c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/core/dom/get-html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function appendOpenTag(node, attrs, result) {
109109

110110
attrs.forEach((attr) => {
111111
if (node.hasAttribute(attr)) {
112-
result.push(` ${attr}="${escapeHtml(node.getAttribute(attr))}"`);
112+
result.push(` ${attr}="${escapeHtml(node.getAttribute(attr) ?? '')}"`);
113113
}
114114
});
115115

0 commit comments

Comments
 (0)