Skip to content
This repository has been archived by the owner on Oct 30, 2021. It is now read-only.

Commit

Permalink
Fixed crash during defs processing.
Browse files Browse the repository at this point in the history
Closes #131
  • Loading branch information
RazrFalcon committed Jan 26, 2018
1 parent 9acf547 commit 19d5d08
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http:https://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http:https://semver.org/).

## [Unreleased]
### Fixed
- Crash during `defs` processing.

## [0.9.3] - 2018-01-17
### Added
Expand Down
12 changes: 12 additions & 0 deletions src/task/group_defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub fn group_defs(doc: &mut Document) {

// Make 'defs' a first child of the 'svg'.
if svg.first_child() != Some(defs.clone()) {
defs.detach();
svg.prepend(&defs);
}

Expand Down Expand Up @@ -248,6 +249,17 @@ mod tests {
</clipPath>
</defs>
</svg>
");

test!(move_defs_5,
"<svg>
<rect/>
<defs/>
</svg>",
"<svg>
<defs/>
<rect/>
</svg>
");

test!(move_mask_1,
Expand Down

0 comments on commit 19d5d08

Please sign in to comment.