From bb7d7c09a58e0ae3651cc8b616788f1ba100036c Mon Sep 17 00:00:00 2001 From: Subramanya Sastry Date: Tue, 19 Jun 2012 12:34:42 -0500 Subject: [PATCH] Fixed newline stripping in rtve mode. - Only strip newlines after ">" chars (still not robust, but better than stripping everywhere). This prevents useless/incorrect diffs in rtve mode and lets us identify real bugs. Change-Id: Iab7b41c4b3d6351c090f8d3a3070330325e876d4 --- api/ParserService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/ParserService.js b/api/ParserService.js index a4d10f3789..2b4b7e7ed3 100644 --- a/api/ParserService.js +++ b/api/ParserService.js @@ -328,7 +328,7 @@ app.get( new RegExp('/_rtve/(?:(?:(?:' + env.interwikiRegexp + '):+)?(' + env.in var tpr = new TemplateRequest( env, target ), cb = function ( req, res, src, document ) { // strip newlines from the html - var html = document.innerHTML.replace(/[\r\n]/g, ''), + var html = document.innerHTML.replace(/>[\r\n]+/g, '>'), p = new html5.Parser(); p.parse( html ); var newDocument = p.tree.document;