From: Daniel Gruno Date: Thu, 26 Apr 2012 06:09:31 +0000 (+0000) Subject: Remove trailing and leading newlines and spaces caused by xml formatting styles X-Git-Tag: 2.5.0-alpha~7020 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0fbe07f71609b37d57d9a05690c7c45ec4495354;p=apache Remove trailing and leading newlines and spaces caused by xml formatting styles git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1330665 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/style/scripts/prettify.js b/docs/manual/style/scripts/prettify.js index f287cdecc1..20ca6930fb 100644 --- a/docs/manual/style/scripts/prettify.js +++ b/docs/manual/style/scripts/prettify.js @@ -546,6 +546,10 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[ text = text.replace(/[ \t\r\n]+/g, ' '); } else { text = text.replace(/\r\n?/g, '\n'); // Normalize newlines. + text = text.replace(/^\r?\n\s*/g, ''); // Remove leading newlines + text = text.replace(/^\s*/g, ''); // Remove leading spaces due to indented formatting + text = text.replace(/\r?\n\s*$/g, ''); // Remove ending newlines + } // TODO: handle tabs here? chunks[k] = text;