Home output html in multiple lines
Reply: 1

output html in multiple lines

Philip Hosea Christianto
1#
Philip Hosea Christianto Published in 2018-01-10 05:25:58Z

I'm using Skybrud Social to get Instagram feeds.

The caption I got from the feed is something like below:

Line 1

Line 2

Line 3

When I output it to html it will be

Line 1 Line 2 Line 3

How do I make it so that it display just like the first?

s = CurrentPage;
Skybrud.Social.Umbraco.Instagram.PropertyEditors.OAuth.InstagramOAuthData client = s.ig;
var service = InstagramService.CreateFromAccessToken(client.AccessToken);
var response = service.Tags.GetRecentMedia("invitation",10);
foreach (Skybrud.Social.Instagram.Objects.InstagramMedia mediaig in response.Body.Data)
{
   <div class="col-md-4">    
       <div class="row" >
           <a class="template" href="@mediaig.Link">
               <div class="col-xs-12 templateIconDiv">
                   <div class="templateIconDivContainer">
                       <img class="templateIcon" 
                       src="@mediaig.Images.StandardResolution.Url">
                   </div>        
                   <div class="col-xs-12 templateName">
                       @Html.Raw(mediaig.Caption.Text)
                   </div>              

               </div>
           </a>
       </div>
   </div>
}
Philip Hosea Christianto
2#
Philip Hosea Christianto Reply to 2018-01-12 07:49:08Z

Fixed with

   <div class="col-xs-12 templateName" style="white-space: pre-line;">
                   @Html.Raw(mediaig.Caption.Text)
               </div>              
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.320719 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO