diff --git a/lib/processings/prefixize.js b/lib/processings/prefixize.js index 94aede7..5d5744f 100644 --- a/lib/processings/prefixize.js +++ b/lib/processings/prefixize.js @@ -31,8 +31,25 @@ module.exports = function (doc, prefix) { $('*').each(function () { var $elem = $(this); + var isStyleTag = $elem[0].name === 'style'; var attrs = $elem.attr(); + if (isStyleTag) { + var content = $elem.text(); + var id; + var match; + + while ((match = urlPattern.exec(content)) !== null) { + id = match[1]; + if (!!mappedIds[id]) { + mappedIds[id].referenced = true; + content = content.replace(match[0], 'url(#' + mappedIds[id].id + ')'); + } + } + + id && $elem.text(content); + } + Object.keys(attrs).forEach(function (key) { var value = attrs[key]; var id; @@ -56,4 +73,4 @@ module.exports = function (doc, prefix) { } }); }); -}; \ No newline at end of file +};