You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Twitter::linkify() has the line $text = preg_replace('/\s+/', ' ', $text);. This strips out consecutive line breaks. I'm not sure why the linkify tries to remove extra spaces, but at the least it should probably limit it to space (ascii 32) characters.
To Reproduce
Steps to reproduce the behavior:
Retrieve a tweet with consecutive line breaks ex. \n\n
Run Twitter::linkify($tweet)
See that it strips the line breaks out, preventing using nl2br() to show the tweet as written.
Expected behavior
Leave line breaks in the returned string.
Version
2.2.11
Additional context
This may be because the tweet is retrieved via "tweet_mode = extended", perhaps the linkify could contextually strip out spaces or not if the tweet has the text property vs. the full_text property.
The text was updated successfully, but these errors were encountered:
Describe the bug
Twitter::linkify() has the line
$text = preg_replace('/\s+/', ' ', $text);
. This strips out consecutive line breaks. I'm not sure why the linkify tries to remove extra spaces, but at the least it should probably limit it to space (ascii 32) characters.To Reproduce
Steps to reproduce the behavior:
nl2br()
to show the tweet as written.Expected behavior
Leave line breaks in the returned string.
Version
2.2.11
Additional context
This may be because the tweet is retrieved via "tweet_mode = extended", perhaps the linkify could contextually strip out spaces or not if the tweet has the
text
property vs. thefull_text
property.The text was updated successfully, but these errors were encountered: