Skip to content

Commit

Permalink
Merge a67c68e into 32fa806
Browse files Browse the repository at this point in the history
  • Loading branch information
mangoischke committed Nov 25, 2019
2 parents 32fa806 + a67c68e commit c260a1d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2.1.2
=====

* single and double quotes can won't be encoded anymore in content meaning content can now be a json string in `HTMLElement`s.

2.1.1
=====

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"php": "^7.2"
},
"require-dev": {
"becklyn/php-cs": "^2.0.2"
"becklyn/php-cs": "^2.0.2",
"symfony/phpunit-bridge": "^4.3.8"
},
"config": {
"sort-packages": true
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/HtmlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function buildElement (HtmlElement $element) : string
}
else
{
$content[] = \htmlspecialchars($entry);
$content[] = \htmlspecialchars($entry, \ENT_NOQUOTES);
}
}

Expand Down
4 changes: 4 additions & 0 deletions tests/Builder/HtmlBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public function provideElements ()
new HtmlElement("p", [], ["a ", new SafeMarkup("This is <b>bold</b>!"), " c"]),
'<p>a This is <b>bold</b>! c</p>',
],
[
new HtmlElement("script", ["type" =>"application/json"], ['{"foo": "bar"}']),
'<script type="application/json">{"foo": "bar"}</script>',
],
];
}

Expand Down

0 comments on commit c260a1d

Please sign in to comment.