You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by hu...@apache.org on 2012/04/26 08:09:31 UTC
svn commit: r1330665 -
/httpd/httpd/trunk/docs/manual/style/scripts/prettify.js
Author: humbedooh
Date: Thu Apr 26 06:09:31 2012
New Revision: 1330665
URL: http://svn.apache.org/viewvc?rev=1330665&view=rev
Log:
Remove trailing and leading newlines and spaces caused by xml formatting styles
Modified:
httpd/httpd/trunk/docs/manual/style/scripts/prettify.js
Modified: httpd/httpd/trunk/docs/manual/style/scripts/prettify.js
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/style/scripts/prettify.js?rev=1330665&r1=1330664&r2=1330665&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/style/scripts/prettify.js (original)
+++ httpd/httpd/trunk/docs/manual/style/scripts/prettify.js Thu Apr 26 06:09:31 2012
@@ -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;