diff --git a/Mf2/Parser.php b/Mf2/Parser.php index 0dc5069..63a85b0 100644 --- a/Mf2/Parser.php +++ b/Mf2/Parser.php @@ -887,7 +887,7 @@ public function parseE(\DOMElement $e) { } $return = array( - 'html' => $html, + 'html' => unicodeTrim($html), 'value' => unicodeTrim($this->innerText($e)), ); diff --git a/tests/Mf2/ParserTest.php b/tests/Mf2/ParserTest.php index 2780184..904866a 100644 --- a/tests/Mf2/ParserTest.php +++ b/tests/Mf2/ParserTest.php @@ -106,6 +106,20 @@ public function testParseEWithBR() { $this->assertEquals('Here is content with two lines.'."\n".'The br tag should not be converted to an XML br/br element.', $output['items'][0]['properties']['content'][0]['value']); } + public function testParseEWithWhitespace() { + $input = '