Permalink
Browse files

don't prepend empty mhtml headers

  • Loading branch information...
1 parent 1670022 commit cf25dd8d058e75c7a77c896bdb0ff6ddf0eea135 phred committed Apr 8, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/net/nczonline/web/cssembed/CSSURLEmbedder.java
View
4 src/net/nczonline/web/cssembed/CSSURLEmbedder.java
@@ -153,6 +153,7 @@ public void embedImages(Writer out, String root) throws IOException {
StringBuilder builder = new StringBuilder();
StringBuilder mhtmlHeader = new StringBuilder();
HashMap<String,Integer> foundMedia = new HashMap<String,Integer>();
+ int conversions = 0;
String line;
int lineNum = 1;
@@ -257,6 +258,7 @@ public void embedImages(Writer out, String root) throws IOException {
builder.append(getMHTMLPath());
builder.append("!");
builder.append(entryName);
+ conversions++;
} else if (hasOption(DATAURI_OPTION)){
builder.append(uriString);
}
@@ -282,7 +284,7 @@ public void embedImages(Writer out, String root) throws IOException {
}
reader.close();
- if (hasOption(MHTML_OPTION)){
+ if (hasOption(MHTML_OPTION) && conversions > 0){
//Add one more boundary to fix IE/Vista issue
mhtmlHeader.append("\n--");

0 comments on commit cf25dd8

Please sign in to comment.