Skip to content

Commit a944b80

Browse files
committed
SVG's are now allowed to have the default parameters removed.
Updated tests to check `CDATA` handling. Updated dependencies.
1 parent 86ec2f0 commit a944b80

File tree

4 files changed

+43
-27
lines changed

4 files changed

+43
-27
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"minimum-stability": "stable",
1616
"require": {
1717
"php": ">=8.1",
18-
"hexydec/tokenise": "1.0.2",
19-
"hexydec/cssdoc": "1.2.1",
20-
"hexydec/jslite": "1.0.5"
18+
"hexydec/tokenise": "1.0.3",
19+
"hexydec/cssdoc": "1.2.2",
20+
"hexydec/jslite": "1.0.6"
2121
},
2222
"autoload": {
2323
"classmap": ["src/"]

composer.lock

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ public function __construct(array $config = []) {
124124
'svg' => [
125125
'lowercase' => false,
126126
'attributes' => [
127-
'default' => false,
128127
'empty' => false,
129128
'option' => false,
130129
'boolean' => false

tests/minifyHtmldocTest.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,25 @@ public function testCanMinifyCssAndJs() {
308308
font-weight: bold;
309309
}
310310
]]>
311-
</style>' => '<style><![CDATA[.test{display:block;font-weight:700}]]></style>',
311+
</style>' => '<style>.test{display:block;font-weight:700}</style>',
312+
'<svg>
313+
<style type="text/css">
314+
.test {
315+
display: block;
316+
font-weight: bold;
317+
}
318+
</style>
319+
</svg>' => '<svg><style><![CDATA[.test{display:block;font-weight:700}]]></style></svg>',
320+
'<svg>
321+
<style type="text/css">
322+
<![CDATA[
323+
.test {
324+
display: block;
325+
font-weight: bold;
326+
}
327+
]]>
328+
</style>
329+
</svg>' => '<svg><style><![CDATA[.test{display:block;font-weight:700}]]></style></svg>',
312330
'<script type="text/javascript" async="async">
313331
(function () {
314332
console.log("Test");
@@ -318,7 +336,6 @@ public function testCanMinifyCssAndJs() {
318336
foreach ($tests AS $key => $item) {
319337
$doc = new htmldoc();
320338
$doc->load($key);
321-
$this->assertEquals($key, $doc->html(), 'Can load CSS and Javascript');
322339

323340
// minify the code
324341
$doc->minify();

0 commit comments

Comments
 (0)