Completed
Pull Request — master (#3)
by Helpful
02:06
created
code/HTML5Value.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
3 3
 class SS_HTML5Value extends SS_HTMLValue {
4 4
 
5 5
 	public function setContent($content) {
6
-		require_once(HTML5LIB_PATH.'/HTML5/Parser.php');
6
+		require_once(HTML5LIB_PATH . '/HTML5/Parser.php');
7 7
 
8 8
 		// Convert any errors to exceptions
9 9
 		set_error_handler(
10
-			function($no, $str){
11
-				throw new Exception("HTML Parse Error: ".$str);
10
+			function($no, $str) {
11
+				throw new Exception("HTML Parse Error: " . $str);
12 12
 			},
13 13
 			error_reporting()
14 14
 		);
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 		// Use HTML5lib to parse the HTML fragment
17 17
 		try {
18 18
 			$document = HTML5_Parser::parse(
19
-				'<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head>'.
19
+				'<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head>' .
20 20
 				"<body>$content</body></html>"
21 21
 			);
22 22
 		}
Please login to merge, or discard this patch.
tests/HTML5ValueTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@  discard block
 block discarded – undo
7 7
 	public function testInvalidHTMLParsing() {
8 8
 		$value = new SS_HTML5Value();
9 9
 
10
-		$invalid = array (
10
+		$invalid = array(
11 11
 			'<p>Enclosed Value</p></p>'                              => '<p>Enclosed Value</p><p></p>',
12 12
 			'<meta content="text/html"></meta>'                      => '<meta content="text/html">',
13 13
 			'<p><div class="example"></div></p>'                     => '<p></p><div class="example"></div><p></p>'
14 14
 		);
15 15
 		
16
-		foreach($invalid as $input => $expected) {
16
+		foreach ($invalid as $input => $expected) {
17 17
 			$value->setContent($input);
18 18
 			$this->assertEquals($expected, $value->getContent(), 'Invalid HTML can be parsed');
19 19
 		}
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			'<html><div><a href="test-link"></a></a></html_>'
42 42
 		);
43 43
 		
44
-		foreach($invalid as $input) {
44
+		foreach ($invalid as $input) {
45 45
 			$value->setContent($input);
46 46
 
47 47
 			$this->assertEquals(
Please login to merge, or discard this patch.