* Preserves tabs and newlines as given (they would otherwise be normalized to spaces by the XML input processor)
* When generating output back to wiki text, this avoids line-based block parsing breakage. (bug 6577)
$out = '<' . $element;\r
if( !is_null( $attribs ) ) {\r
foreach( $attribs as $name => $val ) {\r
- $out .= ' ' . $name . '="' . htmlspecialchars( $val ) . '"';\r
+ $out .= ' ' . $name . '="' . Sanitizer::encodeAttribute( $val ) . '"';\r
}\r
}\r
if( is_null( $contents ) ) {\r
!!end
+!! test
+Fuzz testing: encoded newline in generated HTML replacements (bug 6577)
+!! input
+<pre dir=" "></pre>
+!! result
+<pre dir=" "></pre>
+
+!! end
+
!! test
Parsing optional HTML elements (Bug 6171)
!! options