Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

In users/{id}/timeline, the detail field for comment events is formatted with Markdown and not HTML. Is it normal?

I saw in the question Comments are returning markdown that the API should return HTML comments and I wonder if it's always the case.

EDIT
Here's a sample request: http://api.stackoverflow.com/1.1/users/22656/timeline Output:

{
  "total": 35457,
  "page": 1,
  "pagesize": 30,
  "user_timelines": [
    {
      "user_id": 22656,
      "timeline_type": "comment",
      "post_id": 5057438,
      "post_type": "answer",
      "comment_id": 5663582,
      "action": "comment",
      "creation_date": 1298217147,
      "description": "[java] insertion sort - syntax question",
      "detail": "@aioobe: I've undone the downvote, but I think it's clearer to talk about what the *general* translation is... it's not like the compiler is *actually* going to put the decrement after the assignment."
    },
    ...
   ]
}

The detail property contains text like *general* or *actually*.

Thanks!

share|improve this question
    
Showing a sample query would help. If this is true, it's probably a bug. –  Nikita Rybak Feb 20 '11 at 17:09
    
@Nikita You're right, I've joined a sample request. –  Jilouc Feb 20 '11 at 17:29

1 Answer 1

up vote 2 down vote accepted

It is something of a historical accident that this method returns markdown, however it has become too dangerous to change it.

Consider it for 1.0 and 1.1.

share|improve this answer
    
@Kevin you seriously expect apps to convert the markdown in HTML, in order to display it in a user friendly way. I'd love to know how the backend of the API works; if changing this is considered dangerous, it seems the API is held together with bits of tape, and a few kicks. –  Jonathan. Feb 20 '11 at 20:46
    
@Jonathan I don't know but if this is an old bug, fixing it may break existing apps that have worked around it. This is far from perfect, but I'll find a workaround too. –  Jilouc Feb 20 '11 at 21:16
    
@Jilouc considering this seems to be the only route which returns markdown over HTML, and previously it was said this was a bug that has been fixed, it's pretty safe to assume that apps have not gone to the trouble of implementing markdown->HTML for this one occasion? –  Jonathan. Feb 20 '11 at 21:26
    
@Jonathan That was just a guess. I don't know how the API works internally so when Kevin says it's dangerous to fix it for the moment, I believe him. I'm going to use comments/{id} with vectorized comment ids to get the HTML version of timeline comments. –  Jilouc Feb 20 '11 at 21:46
    
@Jonathan - this is not a comment (comments are returned by /comments, /questions?comments=true, and so on), it is referring to a comment. The referred to bug did, originally, return html and when it switched to markdown that was a bug. This method has always returned markdown. –  Kevin Montrose Feb 20 '11 at 21:46
    
@Jilouc - the simplest workaround is to query /comments/{id} for the html equivalent, and is the only one I've seen in practice. Pulling in a markdown renderer (even our OSS one) is probably overkill. –  Kevin Montrose Feb 20 '11 at 21:47
    
@Kevin, but why have one route return markdown and the others HTML, that's inconsistant, and you've just said that using markdown renderer is overkill, and that another request should be made, something that has been previously said should be kept to a minimum. –  Jonathan. Feb 20 '11 at 22:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .