Skip to content

Commit 506a4eb

Browse files
authored
Add support for boolean attributes with empty string value. Fixes #17
1 parent 4bf274f commit 506a4eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ export default function renderToString(vnode, context, opts, inner) {
134134
if (name==='dangerouslySetInnerHTML') {
135135
html = v && v.__html;
136136
}
137-
else if ((v || v===0) && typeof v!=='function') {
138-
if (v===true) {
137+
else if ((v || v===0 || v==='') && typeof v!=='object' && typeof v!=='function') {
138+
if (v===true || v==='') {
139139
v = name;
140140
// in non-xml mode, allow boolean attributes
141141
if (!opts || !opts.xml) {

0 commit comments

Comments
 (0)