You are here

function _HWLDF_WordAccumulator::addWords in Diff 7.2

Same name and namespace in other branches
  1. 5.2 DiffEngine.php \_HWLDF_WordAccumulator::addWords()
  2. 5 DiffEngine.php \_HWLDF_WordAccumulator::addWords()
  3. 6.2 DiffEngine.php \_HWLDF_WordAccumulator::addWords()
  4. 6 DiffEngine.php \_HWLDF_WordAccumulator::addWords()
  5. 7.3 DiffEngine.php \_HWLDF_WordAccumulator::addWords()

File

./DiffEngine.php, line 979
A PHP diff engine for phpwiki. (Taken from phpwiki-1.3.3)

Class

_HWLDF_WordAccumulator
@todo document @private @subpackage DifferenceEngine

Code

function addWords($words, $tag = '') {
  if ($tag != $this->_tag) {
    $this
      ->_flushGroup($tag);
  }
  foreach ($words as $word) {

    // new-line should only come as first char of word.
    if ($word == '') {
      continue;
    }
    if ($word[0] == "\n") {
      $this
        ->_flushLine($tag);
      $word = drupal_substr($word, 1);
    }
    assert(!strstr($word, "\n"));
    $this->_group .= $word;
  }
}