Well, we don't want to end up with tags as parts of a word.  I would think
hyphenated words should be diff'd sanely.
On May 30, 2014 5:20 PM, "Josh Schroeder" <notifications@github.com> wrote:

> In lib/Caxy/HtmlDiff/HtmlDiff.php:
>
> > @@ -195,7 +201,10 @@ private function convertHtmlToListOfWords($characterString)
> >                      $current_word = $character;
> >                      $mode = 'whitespace';
> >                  } else {
> > -                    if ( ctype_alnum( $character ) && ( strlen($current_word) == 0 || ctype_alnum( $current_word ) ) ) {
> > +                    if (
> > +                        (ctype_alnum($character) && (strlen($current_word) == 0 || $this->isSingleWord($current_word))) ||
> > +                        (in_array($character, $this->specialCaseChars) && isset($characterString[$i+1]) && $this->isSingleWord($characterString[$i+1]))
> > +                    ) {
>
> This is a pretty messy if statement, I'll figure out a way to clean it up.
>
> I do have a question on implementation:
> As you can see I added the specialCaseChars array for characters that
> should be considered part of the 'word' when inside it. I only set it to
> period and comma here.
>
> I'm wondering if I should change it so that any character would be
> considered part of the word if inside, instead of whitelisting (consider
> part of the word if not alpha-numeric but the next character in text is
> anything other than whitespace).
>
> For example, by including all chars, then: this-is-hyphenated would be
> considered one word, instead of breaking it up like |this|-|is|-|hyphenated|
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/caxy/php-htmldiff/pull/3/files#r13254106>.
>