Add temporary workaround for XML parsing errors on imported notes in generated reports

Still invalid XML, but serve as text/html to avoid error
This commit is contained in:
Dan Stillman 2011-04-27 21:33:01 +00:00
parent 186aade141
commit 824eb06c73

View file

@ -470,9 +470,22 @@ function ChromeExtensionHandler() {
break;
default:
var content = Zotero.Report.generateHTMLDetails(items, combineChildItems);
// Serve invalid XML as text/html
//
// This is a temporary workaround until we figure out
// something better.
try {
var xml = new XML(content.replace(/^<\!DOCTYPE [^>]+>\n/, '').trim());
mimeType = 'application/xhtml+xml';
}
catch (e) {
Zotero.debug(e);
mimeType = 'text/html';
}
format = 'html';
mimeType = 'application/xhtml+xml';
content = Zotero.Report.generateHTMLDetails(items, combineChildItems);
}
}
catch (e){