查看GitHub评论的原始降价

时间:2015-12-05 14:48:57

标签: github

如何在GitHub问题中查看评论的降价?例如,我想看看构成此评论的Markdown: https://github.com/jashkenas/backbone/issues/3857#issue-116738665

4 个答案:

答案 0 :(得分:3)

首先,第一篇文章是实际问题本身,无法访问GitHub issue API

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

该列表只有3条评论,因为第一篇文章不是评论。

问题本身有一个格式化的正文:

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

返回:

  "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",

这不是完全 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有两张图片,所以那些花哨的效果都没有标记:

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)

答案 1 :(得分:2)

您可以使用“报价回复”(点击评论右上角的三个点后找到)来查看原始减价。

这是您要求发表评论的开头:

在Safari中,将使用Unicode字符串的路径传递给navigate这样的方法

Backbone.history.navigate('/city/北京',{trigger:true});

哈希不正确。输出

location.hash
//> #/city/%17%AC

...

答案 2 :(得分:2)

只需在以下网址中替换用户名,别名和发行号:

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

Here是一个例子

答案 3 :(得分:1)

可能已经晚了。但我可以这样做(至少在Firefox中)。

我假设您打算复制评论的格式。

这不是一个确切的解决方案,但由于GitHub在评论中支持HTML标记,因此可以正常使用。

  1. 右键单击要复制的注释顶部的某个位置。
  2. 检查元素
  3. 在“检查元素”框中,您会在突出显示的行上方找到一行代码,其中包含以下代码:

    <td class="d-block comment-body markdown-body js-comment-body">

  4. 右键单击具有上述代码的行

  5. 选择复制&gt;内部HTML

  6. 现在,您可以将其粘贴到评论框中,进行预览,然后您就可以看到相同的格式,或使用online HTML to MD converter