MitjaBezensek / SharpBucket

SharpBucket is a .Net wrapper for the Bitbucket's REST API.
MIT License
67 stars 59 forks source link

I have the description of the Pull Request formatted. Example: bold, list, table, images. How can I get this Html for a friendlier presentation? #119

Closed tiago-mateus closed 5 years ago

tiago-mateus commented 5 years ago

I have the description of the Pull Request formatted. Example: bold, list, table, images. How can I get this Html for a friendlier presentation?

mnivet commented 5 years ago

I don't really understand. The description property in PullRequest object (which could be retrieved with GetPullRequest() method) is not html formatted.

It's probably a string that can be formatted to HTML using markdown, and if it's what you want to achieve, you will need a tool to convert markdown to html (a quick search on google give me at least that one in donet: https://github.com/lunet-io/markdig), to format the string in something nice to print it in HTML

Sometimes the Bitbucket API send us both a raw string and an HTML string like in comments that you may retrieved through GetPullRequestLog()[i].comment?.content?.html or GetPullRequestLog()[i].comment?.content?.raw Maybe you have notice that since your question was initially on GetPullRequestLog(). In that case you just have to read the property that correspond to your needs, since bitbucket already offer us a formatted version. But all strings (title, descriptions ands so on) are not provided like that by bitbucket

tiago-mateus commented 5 years ago

Thanks!