This project is not covered by Drupal’s security advisory policy.

Before the HTML is stored in the database, White Space Filter removes all duplications of white space's. This will results in smaller text fields, less disk space, and smaller files. The requirement on processing power is low since this is done when submitting content. This will remove spaces, tabs, CR's and LF's. It will not effect the display of the document, nor touch (or effect) any of the HTML tags.

This has been tested on 5.6 and 5.7 but should work with all version 5. Please feel free to test this on other versions, so that we may increase the scope of the module. Also please report WYSIWYG editors that do not filter white spaces.

BENIFITS

Better HTML Teaser Generation. Smaller Text in Database. Reduced File Size for end User Download. Faster Searches.

NOTES

  1. FCKEditor does not include excessive white spaces when you type in the code, however it has been seen that on a paste to FCKEditor, that the editor does not remove these whitespaces.
  2. This editor will replace the line break filter or other filters that help prepare the text for the Node_Teaser object. Node_Teaser attempts to generate a Teaser from the body of the text, however it has been noted that LB's and CR's will break this feature. This is by design of the Node_Teaser as another condition to generate teasers from text entries. This function will help eliminate the problem when HTML is entered.
  3. This should be used in "Filtered HTML input format" and "Full HTML". It Maybe used in PHP mode if there is not more then one white space included within the variables, or within the SQL. If you run a conditional statement that needs two whitespaces (ex " Mike") then it will remove the second whitespace, and the conditional statement will fail.

EXAMPLES

This code only effects the source, and does not touch any tags. It will not effect the display of HTML

HTML

My                     name          is       Mike              Parisi              and            I          am               Writing <!-- notice a carrage return --->
HTML                 that               has allot of white spaces.

...will become...
My name is Mike Parisi and I am Writing <!-- notice a carrage return ---> HTML that has allot of white spaces.

PHP

// Will attempt to fix this in the next version!
// PHP code can fails because the white spaces within PHP strings could be important, though I know of no case where this exists,

<?PHP if   ($ILOVEGREENJELLY == “    TRUE”)   { print "you rock";} else
      { print "You don't rock"; }?>

RESULTS:
<?PHP if ($ILOVEGREENJELLY == “ TRUE”) { print "you rock";} else { print "You don't rock"; }?>

Project information

Releases