diff --git a/src/HtmlBuilder.php b/src/HtmlBuilder.php index d2ba3cd..fa6f319 100755 --- a/src/HtmlBuilder.php +++ b/src/HtmlBuilder.php @@ -162,7 +162,7 @@ class HtmlBuilder $title = $this->entities($title); } - return $this->toHtmlString('attributes($attributes) . '>' . $title . ''); + return $this->toHtmlString('attributes($attributes) . '>' . $title . ''); } /** diff --git a/tests/HtmlBuilderTest.php b/tests/HtmlBuilderTest.php index b5d7d99..9a4d486 100644 --- a/tests/HtmlBuilderTest.php +++ b/tests/HtmlBuilderTest.php @@ -118,8 +118,11 @@ class HtmlBuilderTest extends PHPUnit_Framework_TestCase $result2 = $this->htmlBuilder->link("http://www.example.com", "Example.com", ["class" => "example-link"], null, false); + $result3 = $this->htmlBuilder->link("https://a.com/b?id=4¬_id=5", "URL which needs escaping"); + $this->assertEquals('<span>Example.com</span>', $result1); $this->assertEquals('Example.com', $result2); + $this->assertEquals('URL which needs escaping', $result3); } public function testMailto()