www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 824eb06c73e65d887c508037599229a4f18df0e1
parent 186aade1416b96b7071c6a04686af35c364a68eb
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed, 27 Apr 2011 21:33:01 +0000

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

Still invalid XML, but serve as text/html to avoid error


Diffstat:
Mcomponents/zotero-protocol-handler.js | 17+++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/components/zotero-protocol-handler.js b/components/zotero-protocol-handler.js @@ -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){