mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
Make the parser service slightly more robust against serializer failures
Change-Id: I50624a56fd0319f6acb6fd1c171c7c6f92a97d31
This commit is contained in:
parent
ebcd6d2941
commit
64d2a089d8
|
@ -264,6 +264,9 @@ var roundTripDiff = function ( req, res, src, document ) {
|
||||||
res.write(document.body.innerHTML + '<hr>');
|
res.write(document.body.innerHTML + '<hr>');
|
||||||
res.write( '<h2>HTML DOM converted back to Wikitext</h2><hr>' );
|
res.write( '<h2>HTML DOM converted back to Wikitext</h2><hr>' );
|
||||||
var out = new WikitextSerializer({env: env}).serializeDOM( document.body );
|
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('<pre>' + htmlSpecialChars( out ) + '</pre><hr>\n');
|
res.write('<pre>' + htmlSpecialChars( out ) + '</pre><hr>\n');
|
||||||
res.write( '<h2>Diff between original Wikitext (green) and round-tripped wikitext (red)</h2><hr>\n' );
|
res.write( '<h2>Diff between original Wikitext (green) and round-tripped wikitext (red)</h2><hr>\n' );
|
||||||
var patch;
|
var patch;
|
||||||
|
|
Loading…
Reference in a new issue