tighten.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP version 4 |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2003 The PHP Group |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.0 of the PHP license, |
  9. // | that is bundled with this package in the file LICENSE, and is |
  10. // | available through the world-wide-web at |
  11. // | http://www.php.net/license/2_02.txt. |
  12. // | If you did not receive a copy of the PHP license and are unable to |
  13. // | obtain it through the world-wide-web, please send a note to |
  14. // | license@php.net so we can mail you a copy immediately. |
  15. // +----------------------------------------------------------------------+
  16. // | Authors: Paul M. Jones <pmjones@ciaweb.net> |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id: tighten.php,v 1.1 2004/01/04 01:35:23 pmjones Exp $
  20. /**
  21. *
  22. * This rule removes all newlines from the source text.
  23. *
  24. * @author Paul M. Jones <pmjones@ciaweb.net>
  25. *
  26. * @package Text_Wiki
  27. *
  28. */
  29. class Text_Wiki_Rule_tighten extends Text_Wiki_Rule {
  30. /**
  31. *
  32. * Simple parsing method to apply tightening directly to the tokens
  33. * array.
  34. *
  35. * @access public
  36. *
  37. */
  38. function parse()
  39. {
  40. $this->_wiki->_source = str_replace("\n", "",
  41. $this->_wiki->_source);
  42. }
  43. }
  44. ?>