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
|
@ -470,9 +470,22 @@ function ChromeExtensionHandler() {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
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';
|
format = 'html';
|
||||||
mimeType = 'application/xhtml+xml';
|
|
||||||
content = Zotero.Report.generateHTMLDetails(items, combineChildItems);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e){
|
catch (e){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user