Skip to content

Commit c955fa0

Browse files
committed
Removed rendering of CDATA tags, it now just removes them.
1 parent 2049936 commit c955fa0

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/tokens/document.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ class document {
1515
*/
1616
public array $rules = [];
1717

18-
/**
19-
* @var bool Whether to wrap in CDATA tags
20-
*/
21-
public bool $cdata = false;
22-
2318
/**
2419
* Constructs the comment object
2520
*
@@ -41,9 +36,6 @@ public function parse(tokenise $tokens) : bool {
4136
// parse tokens
4237
while (($token = $tokens->next()) !== null) {
4338
switch ($token['type']) {
44-
case 'cdataopen':
45-
$this->cdata = true;
46-
break;
4739
case 'directive':
4840
$item = new directive($this->root);
4941
$item->parse($tokens);
@@ -54,6 +46,7 @@ public function parse(tokenise $tokens) : bool {
5446
break 2;
5547
case 'comment':
5648
case 'whitespace':
49+
case 'cdataopen':
5750
case 'cdataclose':
5851
break;
5952
default:
@@ -92,15 +85,15 @@ public function minify(array $minify) : void {
9285
*/
9386
public function compile(array $options) : string {
9487
$b = $options['style'] !== 'minify';
95-
$css = $this->cdata ? '<![CDATA[' : '';
88+
$css = '';
9689

9790
// compile selectors
9891
$join = '';
9992
foreach ($this->rules AS $item) {
10093
$css .= $join.$item->compile($options);
10194
$join = $b ? "\n\n" : '';
10295
}
103-
return $css.($this->cdata ? ']]>' : '');
96+
return $css;
10497
}
10598

10699
/**

0 commit comments

Comments
 (0)