Message with html tags doesn't render properly

Regular Visitor

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

 

  • I have posted message on Yammer with hyperlinks.

  On Yammer :

JyotiRajpurohit1_0-1616486627520.jpeg

  • 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.

 

    On Site :

JyotiRajpurohit1_1-1616486627524.jpeg

  • "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@google.com<https://google.com/> :)", plain: "Yammer Post :- Here's my best wishes to you on I…uck - BeStrong@google.com<https://google.com/> :)", rich: " <br>Yammer Post :<br>- Here's my best wishes to y…follow noreferrer">https://google.com/</a>&gt; :)"}
    1. parsed: " ↵Yammer Post :↵- Here's my best wishes to you on International Women's Day 2021<https://congratulationsto.com/cards/happy-womens-day-image.jpg>! ↵- Click Here  To check the video↵↵↵Good Luck - BeStrong@google.com<https://google.com/> :)"
    2. plain: "↵Yammer Post :↵- Here's my best wishes to you on International Women's Day 2021<https://congratulationsto.com/cards/happy-womens-day-image.jpg>!↵- Click Here To check the video↵↵Good Luck - BeStrong@google.com<https://google.com/> :)"
    3. rich: " <br>Yammer Post :<br>- Here's my best wishes to you on International Women's Day 2021&lt;<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>&gt;! <br>- Click Here  To check the video<br><br><br>Good Luck - BeStrong@google.com&lt;<a class="linkified" href="https://google.com/" target="_blank" rel="nofollow noreferrer">https://google.com/</a>&gt; :)"
  • 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&lt;

                <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>&gt;!

            <br>- Click Here  To check the video<br><br><br>Good Luck - BeStrong@google.com&lt;

                <a class="linkified" href="https://google.com/" target="_blank" rel="nofollow noreferrer">https://google.com/</a>&gt; :)

        </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>&nbsp;</p>

        <p>&nbsp;</p>

        <p><strong>Good Luck - </strong><a href="https://google.com/" title="https://google.com/" rel="nofollow noreferrer" target="_blank"><strong>BeStrong@google.com</strong></a><strong> :)</strong></p>

</div>

 

Kindly help me in this ..

 

Thank You.

0 Replies