From 64d2a089d8936ea8574ea74b6b2d54c46606e7e2 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Wed, 11 Jul 2012 12:01:05 +0200 Subject: [PATCH] Make the parser service slightly more robust against serializer failures Change-Id: I50624a56fd0319f6acb6fd1c171c7c6f92a97d31 --- api/ParserService.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/ParserService.js b/api/ParserService.js index fa3c570c87..19be682658 100644 --- a/api/ParserService.js +++ b/api/ParserService.js @@ -264,6 +264,9 @@ var roundTripDiff = function ( req, res, src, document ) { res.write(document.body.innerHTML + '
'); res.write( '

HTML DOM converted back to Wikitext


' ); var out = new WikitextSerializer({env: env}).serializeDOM( document.body ); + if ( out === undefined ) { + out = "An error occured in the WikitextSerializer, please check the log for information"; + } res.write('
' + htmlSpecialChars( out ) + '

\n'); res.write( '

Diff between original Wikitext (green) and round-tripped wikitext (red)


\n' ); var patch;