Yammer message with html tags doesn't render propertly

Jyoti Rajpurohit 6 Reputation points
2021-03-08T14:16:46.987+00:00

Hi All,

Issue - I am fetching the yammer messages by using REST API(https://developer.yammer.com/docs/messagesjson) with hyperlink and html tags but it doesn't render properly.

  • I have posted message on Yammer with hyperlinks.
    81120-post.png
  • I am fetching the message by using "REST API" and render the same message on site, but it is showing the html hyperlinks in a different format.
    81140-site.png
  • "REST API" returns the Yammer messages in the message.body object with 3 different body objects(parsed, plain & rich) message.body
    1. {urls: Array(2), parsed: " ↵Yammer Post :↵- Here's my best wishes to you on …uck - BeStrong@Madesh .comhttps://google.com/ :)", plain: "↵Yammer Post :↵- Here's my best wishes to you on I…uck - BeStrong@Madesh .comhttps://google.com/ :)", rich: " <br>Yammer Post :<br>- Here's my best wishes to y…follow noreferrer">https://google.com/</a>> :)"}
    1. parsed: " ↵Yammer Post :↵- Here's my best wishes to you on International Women's Day 2021https://congratulationsto.com/cards/happy-womens-day-image.jpg! ↵- Click Here To check the video↵↵↵Good Luck - BeStrong@Madesh .comhttps://google.com/ :)"
    2. plain: "↵Yammer Post :↵- Here's my best wishes to you on International Women's Day 2021https://congratulationsto.com/cards/happy-womens-day-image.jpg!↵- Click Here To check the video↵↵Good Luck - BeStrong@Madesh .comhttps://google.com/ :)"
    3. rich: " <br>Yammer Post :<br>- Here's my best wishes to you on International Women's Day 2021<<a class="linkified" href="https://congratulationsto.com/cards/happy-womens-day-image.jpg" title="https://congratulationsto.com/cards/happy-womens-day-image.jpg" target="_blank" rel="nofollow noreferrer">https://congratulationsto.com/cards/happy-womens-day-image.j…</a>>! <br>- Click Here To check the video<br><br><br>Good Luck - BeStrong@Madesh .com<<a class="linkified" href="https://google.com/" target="_blank" rel="nofollow noreferrer">https://google.com/</a>> :)"
  • Parsed and plain objects having plain html text with no hyperlinks. So I have used the message.body.rich object to fetch the Yammer Post, but it is not having proper html format.

Current Html Format :

<div class="post-excerpt">
<p>
<br>Yammer Post :
<br>- Here's my best wishes to you on International Women's Day 2021<
<a class="linkified" href="https://congratulationsto.com/cards/happy-womens-day-image.jpg" title="https://congratulationsto.com/cards/happy-womens-day-image.jpg" target="_blank" rel="nofollow noreferrer">https://congratulationsto.com/cards/happy-womens-day-image.j…</a>>!
<br>- Click Here To check the video<br><br><br>Good Luck - BeStrong@Madesh .com<
<a class="linkified" href="https://google.com/" target="_blank" rel="nofollow noreferrer">https://google.com/</a>> :)
</p>
</div>

Expected Html Format :

<div class="post-excerpt">
<p>Yammer Post :</p>
<ul>
<li>
Here's my best wishes to you on <a href="https://congratulationsto.com/cards/happy-womens-day-image.jpg" title="https://congratulationsto.com/cards/happy-womens-day-image.jpg" rel="nofollow noreferrer" target="_blank">International Women's Day 2021</a>!
</li>
<li>
<a href="https://www.google.com/logos/2021/video_template/iwd/rc2/main_video_low.mp4" title="https://www.google.com/logos/2021/video_template/iwd/rc2/main_video_low.mp4" rel="nofollow noreferrer" target="_blank"><strong>Click</strong> <strong>Here </strong></a><strong> To check the video</strong>
</li>
</ul>
<p> </p>
<p> </p>
<p><strong>Good Luck - </strong><a href="https://google.com/" title="https://google.com/" rel="nofollow noreferrer" target="_blank"><strong>BeStrong@Madesh .com</strong></a><strong> :)</strong></p>
</div>

Kindly help me in this ..

Thank You

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,204 questions
{count} vote