ConnectApiHelper icon indicating copy to clipboard operation
ConnectApiHelper copied to clipboard

Adding Hyperlink Markup Type Support

Open kg345 opened this issue 5 years ago • 3 comments

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

kg345 avatar Oct 02 '20 01:10 kg345

Thanks for the contribution! Before we can merge this, we need @kg345 to sign the Salesforce.com Contributor License Agreement.

salesforce-cla[bot] avatar Oct 02 '20 01:10 salesforce-cla[bot]

I have been using this addition and I like it. Works very well.

rapsacnz avatar May 11 '23 23:05 rapsacnz

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);

SwiCitairLoWELAwA avatar Mar 15 '24 22:03 SwiCitairLoWELAwA