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:
parent
186aade141
commit
824eb06c73
1 changed files with 15 additions and 2 deletions
|
@ -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){
|
||||
|
|
Loading…
Reference in a new issue