# Double-quoted
return $set[3];
} elseif ( !isset( $set[2] ) ) {
- # In XHTML, attributes must have a value.
- # For 'reduced' form, return explicitly the attribute name here.
- return $set[1];
+ # In XHTML, attributes must have a value so return an empty string.
+ # See "Empty attribute syntax",
+ # http://www.w3.org/TR/html5/syntax.html#syntax-attribute-name
+ return "";
} else {
throw new MWException( "Tag conditions not met. This should never happen and is a bug." );
}
<br title=bar/>
<br title=bar/ >
!! html/php
-<p><br title="title" />
-<br title="title" />
+<p><br title="" />
+<br title="" />
<br />
<br title="bar" />
<br title="bar" />
</p>
!! end
+# Parsoid does not serialize to empty attribute syntax,
+# so wt2wt and html2wt cases are skipped
!! test
-Attribute test: no value
+Attribute test: no value (T54330)
+!! options
+parsoid=wt2html,html2html
!! wikitext
<font color>foo</font>
-!! html
-<p><font color="color">foo</font>
+!! html/php
+<p><font color="">foo</font>
</p>
+!! html/parsoid
+<p><font color="">foo</font></p>
!! end
!! test
'width' => '200',
'height' => '100',
'depth' => '50',
- 'square' => 'square',
+ 'square' => '',
)
</pre>
'width' => '200',
'height' => '100',
'depth' => '50',
- 'square' => 'square',
+ 'square' => '',
)
</pre>
<p>other stuff
<link rel="stylesheet" itemprop="hello" href="{{SERVER}}">
</div>
!! html
-<div itemscope="itemscope">
+<div itemscope="">
<p> <meta itemprop="hello" content="world" />
<meta http-equiv="refresh" content="5">
<meta itemprop="hello" content="5" />
showindicators
!! wikitext
<indicator name="empty" />
-<indicator name></indicator>
+<indicator name="name"></indicator>
!! html
empty=
name=