@@ -3,12 +3,12 @@ discard block |
||
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 |
||
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 | } |
@@ -7,13 +7,13 @@ discard block |
||
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 |
||
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( |