浏览代码

don't group SVG files

Gildas 7 年之前
父节点
当前提交
8cfcf63644
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/single-file/single-file-core.js

+ 1 - 1
lib/single-file/single-file-core.js

@@ -1109,7 +1109,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 									resourceElement.remove();
 								} else {
 									if (content.startsWith(prefixDataURI) || content.startsWith(PREFIX_DATA_URI_NO_MIMETYPE) || content.startsWith(PREFIX_DATA_URI_OCTET_STREAM)) {
-										if (processDuplicates && duplicate && options.groupDuplicateImages && DomUtil.replaceImageSource(resourceElement, SINGLE_FILE_VARIABLE_NAME_PREFIX + indexResource, options)) {
+										if (processDuplicates && duplicate && options.groupDuplicateImages && !content.startsWith(PREFIX_DATA_URI_IMAGE_SVG) && DomUtil.replaceImageSource(resourceElement, SINGLE_FILE_VARIABLE_NAME_PREFIX + indexResource, options)) {
 											DomUtil.insertVariable(doc, indexResource, content, options);
 										} else {
 											resourceElement.setAttribute(attributeName, content);