tweetmoasharp icon indicating copy to clipboard operation
tweetmoasharp copied to clipboard

TextAsHtml property throws an exception when TweetMode is 'Extended'

Open mauroandrea opened this issue 6 years ago • 4 comments

Hi guys.

I'm updating an old site from one of our customers and I replaced the old TweetSharp library with yours so I can remove the 140 char limit.

I saw the property 'TweetMode' in ListTweetsOnUserTimelineOptions, and since I changed it to 'Extended' I'm getting an exception when trying to use the property TextAsHtml.

If I use TweetMode as Compatibility I get the following:

FullText: null Text: Tweet truncated to 140 chars including the URL TextAsHtml: Truncated tweet with HTML for URL and hashtags

If I use TweetMode as Extended I get the following:

FullText: full tweet in plain-text Text: null TextAsHtml: throws an exception

Here's part of the exception I'm getting:

System.ArgumentNullException: Value cannot be null. Parameter name: str at System.Globalization.StringInfo.ParseCombiningCharacters(String str) at TweetSharp.StringExtensions.ParseTextWithEntities(ITweetable tweetable) at TweetSharp.TwitterStatus.get_TextAsHtml()

The rest of the stack trace refers to our client project, which I can't disclose due to our NDA.

Any help will be appreciated. As a workaround, I'll probably do the HTML replacing on the FullText property by myself, after getting the results.

Thanks.

Mauro

mauroandrea avatar Dec 10 '19 20:12 mauroandrea

Hey guys, wondering if there has been any movement on this issue? Encountering the same problem.

Cheers Ryan

RyanTuckNZ avatar Jan 31 '20 01:01 RyanTuckNZ

Hi, sorry everyone. I was working on this in December and I think I have a fix, but I never published an update because I got blocked on a second issue I wanted to ship at the same time, and then I went back to my day job and haven't had time since.

I'll see if I can release an update tonight.

Yortw avatar Jan 31 '20 05:01 Yortw

Hey Troy,

Thanks very much. Let us know how you get on 🙂

Cheers Ryan

RyanTuckNZ avatar Jan 31 '20 06:01 RyanTuckNZ

Awesome! Thank you very much Troy!

mauroandrea avatar Jan 31 '20 06:01 mauroandrea