<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
Zend_Filter_StripSpaces will strip all spaces out of a string. You can specify if you want to strip out all spaces or just the unnecessary ones, means multiple spaces behind one another.Zend Framework: Zend_Filter_StripSpaces Component Proposal
Proposed Component Name
Zend_Filter_StripSpaces
Developer Notes
http://framework.zend.com/wiki/display/ZFDEV/Zend_Filter_StripSpaces
Proposers
Thomas Weidner
Revision
1.0 - 04 Oktober 2009 (wiki revision: 11)
Table of Contents
1. Overview
2. References
3. Component Requirements, Constraints, and Acceptance Criteria
4. Dependencies on Other Framework Components
- Zend_Filter_Interface
- Zend_Filter_Exception
5. Theory of Operation
Based on the specified options, this filter will strip all, more than one and/or also unicode white spaces.
6. Milestones / Tasks
- Milestone 1: [DONE] Proposal finished
- Milestone 2: Proposal accepted
- Milestone 3: Working implementation
- Milestone 4: Unit tests
- Milestone 5: Documentation
- Milestone 6: Moved to core
7. Class Index
- Zend_Filter_StripSpaces
8. Use Cases
| UC-01 |
|---|
Default, stripping multiple whitespaces (textual, unicode and html)
| UC-02 |
|---|
Stripping only multiple textual whitespaces
| UC-03 |
|---|
Stripping all whitespaces
| UC-04 |
|---|
Stripping multiple types of whitespaces
| UC-05 |
|---|
Stripping more than 3 whitespaces
11 Comments
comments.show.hideMar 03, 2008
Martin Hujer
<p>Hi,</p>
<p>this filter maybe should also strip tabs <ac:link><ri:page ri:content-title="\t" /></ac:link></p>
<p>Regards</p>
<p>Martin H.</p>
Apr 18, 2009
Thomas Weidner
<p>Karol, please tell me if you want to do any further progress with this proposal.<br />
Otherwise I will take it over, change it to conform, get it approved and integrated.</p>
<p>Greetings<br />
Thomas Weidner</p>
Jul 28, 2010
Dolf Schimmel (Freeaqingme)
<p>Why can't it filter out other characters on demand of the developer? If I want to filter out all occurrences of 'A' or 'a', this component should be able to. Imho. </p>
Jul 30, 2010
Thomas Weidner
<p>This filter is intended to work only on spaces. You should note that unicode defines other whitespace characters which most people are not aware of.</p>
<p>When you want to have a filter which strips out special characters then I would add a Zend_Filter_StripCharacters... Zend_Filter_StripSpaces would then be an extension of StripCharacters.</p>
<p>I would do this based on this proposal when it's really wished.</p>
Jul 29, 2010
Shaun Farrell
<p>If you have sentences and you used the default stripping what would the use case be for after a "."</p>
<p>Example</p>
<p>"This is a sentence. This is another sentence."</p>
<p>Would it remove the double space after the sentence or leave that in?</p>
Jul 30, 2010
Thomas Weidner
<p>In your example there is no double whitespace after the point.<br />
But when there would be a multiple-whitespace it would be stripped.</p>
<p>It would change TEXT-POINT-SPACE-SPACE-TEXT and return TEXT-POINT-SPACE-TEXT</p>
Jul 30, 2010
Marc Bennewitz (private)
<p>For me it sounds like a html minimizer. This should be discussed with Nick Daugherty's Zend_Filter_Minify_Html.</p>
Jul 30, 2010
Thomas Weidner
<p>No... this proposal is not intended to work on HTML or any other structured content.<br />
It has no knowledge of any structure.</p>
<p>Minify_Html would not work on a plain string text or on a textfile.</p>
Aug 03, 2010
Pádraic Brady
<ac:macro ac:name="note"><ac:rich-text-body><p><strong>Community Review Team Recommendation</strong></p>
<p>The CR Team advises that this proposal may be approved with the condition that the proposer clarify the precise range of characters that will be stripped.</p></ac:rich-text-body></ac:macro>
Aug 03, 2010
Thomas Weidner
<p>As written and proposed this component can strip all sorts of spaces. This would include:</p>
<ul>
<li>Space</li>
<li>Non-Breaking Space</li>
<li>Space Mark</li>
<li>Nut</li>
<li>Mutton</li>
<li>Thick Space</li>
<li>Mid Space</li>
<li>Six-Em Space</li>
<li>Figure Space</li>
<li>Punctation Space</li>
<li>Thin Space</li>
<li>Hair Space</li>
<li>Zero-Width Space</li>
<li>Narrow Non-Breaking Space</li>
<li>Medium Mathematical Space</li>
<li>Word Joiner</li>
<li>Ideographic Space</li>
<li>Zero-Width Non-Breaking Space</li>
</ul>
<p>Each of them can be switched on/off separatly. This component would also recognise the HTML variant and strip it. This can also be switched off per option.</p>
<p>Example:<br />
Non-breaking Space = U+00A0 => HTML Variant = & nbsp;</p>
<p>For each of the above spaces a HTML variant exists.</p>
Aug 04, 2010
Pádraic Brady
<p>Thanks for the clarification Thomas!</p>