tests/ValidHtmlTest.php
/**
	 * HTML strings that are "valid" and should pass.
	 */
HTML strings that are "valid" and should pass.
HTML strings that are " valid " and should pass .
public function provideGoodHtml() {
		return [
			[ '<p>Testing testing</p>' ],
			[ '<p>Foo</p>\n<ul><li>Item</li></ul>' ],
			[ '<ul><li>Item 1</li><li><ul><li>Item 2</li></ul></li></ul>' ],
			[ '<div class="foo"></div>' ],
			[ '<div class="<&quot;>">&lt;"&gt;</div>' ],
			[ '<li>Bare list</li>' ],
			[ '<ul><li>Item 1</li><div>This does not belong</div></ul>' ],
		];
	}
public function provideGoodHtml ( ) { return [ [ '<p>Testing testing</p>' ] , [ '<p>Foo</p>\n<ul><li>Item</li></ul>' ] , [ '<ul><li>Item 1</li><li><ul><li>Item 2</li></ul></li></ul>' ] , [ '<div class="foo"></div>' ] , [ '<div class="<&quot;>">&lt;"&gt;</div>' ] , [ '<li>Bare list</li>' ] , [ '<ul><li>Item 1</li><div>This does not belong</div></ul>' ] , ] ; }
HTML strings that are "valid" and should pass.
HTML strings that are " valid " and should pass .
// Always use double quotes for attributes // Encode &quot; in attributes, and &lt; and &gt; outside of tags // Note that our definition of "valid HTML" is pretty weak // These next violate the HTML content model, but pass our // simple parse-and-reserialize definition of validity. // You can feel free to hold your output to a higher standard. :)