expressodev / twitter_search

Twitter Search 2 plugin for ExpressionEngine 2.x
15 stars 2 forks source link

Text Formatting Craziness #6

Open davist11 opened 11 years ago

davist11 commented 11 years ago

So I've got a pretty basic usage in the templates:

{exp:twitter_search
    q="from:USERNAME"
    rpp="3"
    nofollow="no"
    word_censor="no"
}
    <li>
        {text}
        {relative_tweet_date}
    </li>
{/exp:twitter_search}

It looks like the second tweet has an apostrophe in it, and it ends up being encoded as an entity and then linked with the auto linking. So I started poking around in the plugin, and it looks like $this->EE->typography->text_format changes during iterations of the loop. If I add var_dump($this->EE->typography->text_format); before this line:

$tweet[$prefix.'text'] = $this->EE->typography->parse_type($result->text);

This is the result: string(4) "none" string(5) "xhtml" string(5) "xhtml"

So it seems like something in parse_type is changing the text formatting. I didn't feel like poking around too much, so I just set $this->EE->typography->text_format = "none" inside of the loop.