Skip to content

Commit

Permalink
Fallback to styleElement.text for IE9.
Browse files Browse the repository at this point in the history
IE9 doesn't provide a `textContent` property on this object.  This caused
errors when trying to import SVG files with `<style>` inside them.
  • Loading branch information
toddbc committed Jan 26, 2016
1 parent 100d22a commit 0cdd941
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,8 @@

// very crude parsing of style contents
for (var i = 0, len = styles.length; i < len; i++) {
var styleContents = styles[i].textContent;
// IE9 doesn't support textContent, but provides text instead.
var styleContents = styles[i].textContent || styles[i].text;

// remove comments
styleContents = styleContents.replace(/\/\*[\s\S]*?\*\//g, '');
Expand Down

0 comments on commit 0cdd941

Please sign in to comment.