Skip to content

Commit

Permalink
Parse styles contained within defs
Browse files Browse the repository at this point in the history
fixes #98
  • Loading branch information
bsweeney committed Jan 8, 2024
1 parent 492fd3a commit bcb3822
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Svg/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ function _tagEnd($parser, $name)
break;
}

if (!$this->inDefs && $tag) {
if ((!$this->inDefs && $tag) || $tag instanceof StyleTag) {
$tag->handleEnd();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Svg/Tag/AbstractTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function handle($attributes)

public function handleEnd()
{
if (!$this->getDocument()->inDefs) {
if (!$this->getDocument()->inDefs || $this instanceof StyleTag) {
$this->end();
$this->after();
}
Expand Down

0 comments on commit bcb3822

Please sign in to comment.