Adding Hyperlink Markup Type Support
With Spring 19, hyperlink support was added.
https://releasenotes.docs.salesforce.com/en-us/spring19/release-notes/rn_chatter_hyperlinks.htm
This adds that functionality noted by the following issue: #17
Thanks for the contribution! Before we can merge this, we need @kg345 to sign the Salesforce.com Contributor License Agreement.
I have been using this addition and I like it. Works very well.
I think, this two lines should be added to ConnectApiHelper.createInputFromBody:
markupBeginInput.url = markupBeginOutput.url;
markupBeginInput.altText = markupBeginOutput.altText;
See the place: https://github.com/forcedotcom/ConnectApiHelper/pull/30/files#diff-7e83dc2714494f8be54d84615a298f2c110372f690bca3bed0271fc4b2770db9R354
Otherwise we're getting this error FATAL_ERROR ConnectApi.ConnectApiException: Value of "url" must be not be null.
// item.body contains <a href="https://google.com" title="https://google.com">link</a>
ConnectApi.FeedItem item = ...;
ConnectApi.FeedItemInput input = ConnectApiHelper.createFeedItemInputFromBody(item.body);
ConnectApi.ChatterFeeds.updateFeedElement(communityId, item.id, input);