From 65e4e76731e2fd56a6ce8211caa9e13f08b6ce3a Mon Sep 17 00:00:00 2001 From: Daniel Gruno Date: Thu, 26 Apr 2012 06:09:31 +0000 Subject: [PATCH] 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 --- docs/manual/style/scripts/prettify.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/manual/style/scripts/prettify.js b/docs/manual/style/scripts/prettify.js index f287cdecc15..20ca6930fb0 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; -- 2.47.3