2015-12-05 143 views

回答

2

首先,第一篇文章是实际的问题本身,而不是访问,但在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问题有两个图像,所以这些奇特的效果,没有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) 
+0

我想这是我要得到的最好的。 – duffn

1

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

我假设你的意图是复制评论的格式。

这不是一个确切的解决方案,但由于GitHub在评论中支持HTML标签,这将工作得很好。

  1. 右键单击想要复制的评论顶部的某处。
  2. 检查元素
  3. 在检查元素中,你会发现一条线,这是一个几行突出显示的行具有这种代码上面:

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

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

  5. 选择复制>内在HTML

现在您可以将其粘贴到评论框中,预览它,您将可以看到相同的格式,或者使用online HTML to MD converter