Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View raw markdown of GitHub comment

Tags:

github

How can I view the Markdown of a comment in a GitHub issue? For example, I would like to see the Markdown that makes up this comment: https://github.com/jashkenas/backbone/issues/3857#issue-116738665

like image 462
duffn Avatar asked Dec 05 '15 14:12

duffn


People also ask

How do I view a Markdown in GitHub?

plain=1 to your GitHub markdown file URL: Appending ? plain=1 to the url for any Markdown file will now display the file without rendering. As with other code files, it will also show line numbers, and can be used to link other users to a specific line or lines.

How do I view RAW files on GitHub?

Viewing or copying the raw file contentOn GitHub.com, navigate to the main page of the repository. Click the file that you want to view. In the upper-right corner of the file view, click Raw.

How does GitHub render Markdown?

GitHub uses its own Markdown processor; GitHub Pages uses jekyll-commonmark. This means your README.md file will look different on GitHub's website than on your GitHub Pages website. For example, emoji are rendered on GitHub's website, but not on websites generated using GitHub Pages.

Can you comment out Markdown?

Markdown has no inbuilt support for comment syntax, but extended syntax vendors like GitHub and stackoverflow have provided the syntax, and can not be used with markdown syntax. Html comments can be used in markdown code, <! --- Wrap text ---> is the symbol that will be wrapped with comments text.


2 Answers

Simply replace username, reponame and issue number in the following url:

https://api.github.com/repos/USERNAME/REPONAME/issues/NUMBER/comments

Here's an example

like image 88
stevec Avatar answered Sep 25 '22 17:09

stevec


First, the first post is the actual issue itself, not accessible but the GitHub issue API:

https://api.github.com/repos/jashkenas/backbone/issues/3857/comments

That list only 3 comments, since the first post is not a comment.

The issue itself has a formatted body:

https://api.github.com/repos/jashkenas/backbone/issues/3857

That returns:

  "body": "In Safari , pass a path using unicode string to `navigate` method  like this\r\n\r\n```js\r\nBackbone.history.navigate('/city/北京',{trigger:true});\r\n```\r\nThe hash is incorrect. It output\r\n\r\n```js\r\nlocation.hash\r\n//> #/city/%17%AC\r\n```\r\n\r\nI tracked the code, it caused by `_updateHash` method.\r\n\r\nThe call stack created by  `History.prototype.navigate` method like this\r\n\r\n* navigate\r\n   -  decodeFragment\r\n   - _updateHash\r\n\r\nThe fragment passed to `_updateHash`,  was decoded by `decodeFragment`, so the hash was incorrect。\r\n\r\nI also searched the commit history, the `decodeFragment` added in \"1.2.0\"\r\n\r\nPS: My english is not good, although I am trying to improve\r\n\r\n",

That is not exactly mardown:

    In Safari , pass a path using unicode string to `navigate` method  like this

```js\r\nBackbone.history.navigate('/city/北京',{trigger:true});
```\r\nThe hash is incorrect. It output

```js\r\nlocation.hash
//> #/city/%17%AC
```

I tracked the code, it caused by `_updateHash` method.

The call stack created by  `History.prototype.navigate` method like this

* navigate
   -  decodeFragment
   - _updateHash
The fragment passed to `_updateHash`,  was decoded by `decodeFragment`, so the hash was incorrect。
I also searched the commit history, the `decodeFragment` added in \"1.2.0\"
PS: My english is not good, although I am trying to improve

The second comment in this issue has two images, so those fancy effects are no markdow:

https://cloud.githubusercontent.com/assets/516562/11164567/62f9ddf6-8b2f-11e5-8aa8-631c1aa84422.gif

https://cloud.githubusercontent.com/assets/516562/11164567/62f9ddf6-8b2f-11e5-8aa8-631c1aa84422.gif

[https://jsfiddle.net/leexiaosi/uyp3o6ek/](https://jsfiddle.net/leexiaosi/uyp3o6ek/)

**notice!!!** : please open in safari.

### the record of safari
![safari](https://cloud.githubusercontent.com/assets/516562/11164567/62f9ddf6-8b2f-11e5-8aa8-631c1aa84422.gif)

### the record of chrome
![chrome](https://cloud.githubusercontent.com/assets/516562/11164583/c66d1b82-8b2f-11e5-9d88-ecba16ae6167.gif)
like image 41
VonC Avatar answered Sep 23 '22 17:09

VonC