# Is there a way to view a comment's source?

Sometimes (old) comments break the parser, so it would be nice to view their code to check what was (actually) supposed to be there. Is there any way to view a comment's source just like the source link in a post's revision?

edit Another application for this would be the ability to better quote comments in an answer without having to re-markdown them.

• Got an example?
– Bart
Oct 29, 2013 at 8:50
• I guess you could view the page source and look at the raw HTML? Oct 29, 2013 at 8:53
• @benisuǝqbackwards - It will show the output in the page source too not the actual source we are looking for. Oct 29, 2013 at 8:58
• @Bart: Just try anything with more than one consecutive backtick, backslash or asterisk; examples should be fairly easy to make. Oct 29, 2013 at 8:59
• For what I understand of the system, either this is a feature-request or we need a custom script to "de-parse" the HTML. Oct 29, 2013 at 9:04
• @Bart It's not necessarily restricted to broken display, another reason might be a comment containing some formatting, links or code which one wants to quote in an answer/question without having to reformat everything again... Oct 29, 2013 at 9:04
• @brasofilo Well, if this is currently not possible, I'd indeed re-tag this into a request Oct 29, 2013 at 9:05
• @KerrekSB Ah, I misread. I thought we were talking about old comments no longer displaying right.
– Bart
Oct 29, 2013 at 9:06
• data.stackexchange.com ? It's not as easy as it could be, but I don't think enough people need to see this often enough that it has to be easy. Oct 29, 2013 at 9:16
• @Dukeling Come on, I implicitly meant "intuitive"... Oct 29, 2013 at 9:17
• @TobiasKienzler that's very intuitive - just put the desired post ID and you have all comments listed with their raw source. Oct 29, 2013 at 9:25
• @TobiasKienzler the data explorer updates once a week. Oct 29, 2013 at 13:21
• An example of use - accessing the tex on such an enabled site to easily pull it into a question or answer post.
– user213963
Nov 1, 2013 at 5:09
• @MichaelT Indeed, especially if interspersed with text such that otherwise many show-source-right-clicks were necessary Nov 1, 2013 at 7:36
• I will add link to this answer which mentions a bookmarklet which copies the comments on a question with MathJax and MarkDown. The link in the answer is dead, but the bookmarklet is currently available here: normalhuman.github.io/stackmarklets Mar 14, 2017 at 10:31

Based on Tim's answer, I have constructed this SEDE query.

You can put either the comment ID, or the raw comment URL and get its full details, including the raw source as requested.

To get the comment URL, middle click or right click and choose "Copy link address" over the comment timestamp:

For example, the above will result in such a link: https://meta.stackexchange.com/questions/203390/is-there-a-way-to-view-a-comments-source#comment648179_203390

Now you can either type 648179 in the CommentId text field, or the full link in the RawLink textbox.

For easy copying you might want to run run the Query with the option Text-only results enabled so it becomes easier to copy the raw results.

Note, the SEDE data is updated on a weekly basis, every Sunday or Monday so comments posted in the last week after Sunday or Monday won't show up.

• I'm not sure this works anymore? I tried with a comment from ELL meta and it didn't output anything. Sep 19, 2016 at 10:12
• @Fiksdal yes is still works. Example from ELL meta. What comment exactly did you try? Sep 20, 2016 at 16:05
• This comment. Sep 20, 2016 at 16:14
• @Fiksdal you missed the last paragraph in my answer: "the SEDE data is updated on a weekly basis". Sep 20, 2016 at 16:15
• Ah, thanks :D Got it. Sep 20, 2016 at 16:16
• In case someone is wondering how to get the complete text without downloading the CSV file, you can resize the text column: i.stack.imgur.com/1OTLs.png Oct 16, 2017 at 16:24

You can either use Data Explorer or the API's /comments/{ids} route with the body_markdown filter to get the source of a given comment. Going with one of these options would make more sense than having native site functionality, since this isn't really a common use case.

It's also not too difficult to reverse-engineer the appropriate Markdown based on the resulting HTML source (I have something similar for chat messages from back when I did the Town Hall Digests), but obviously that takes a bit more work than the above-mentioned methods. Plus, when considering edge-cases related to bug reports, the reverse-engineered Markdown may not be identical to the source.