Closed ywjno closed 11 years ago
呵呵,有难度, 必要性不高呢
这需要另外写一个markdown渲染器
貌似 go get github.com/russross/blackfriday
就支持
等我找台机器试试
我的意思是更改markdown渲染库
你就不给我一个pull request的机会
呵呵,那你来试试呗, 两个markdown的API不太一样
我试了一下貌似搞不定。。。
markdown的操作,都在markdown.go里面的
package gor
import (
"bytes"
"github.com/russross/blackfriday"
"log"
)
func MarkdownToHtml(content string) (str string) {
defer func() {
e := recover()
if e != nil {
log.Println(e)
}
}()
str = blackfriday.MarkdownCommon(content)
return
}
没法支持
``` language
这样的代码高亮
我试试
更换markdown库了
great
貌似还不是不能按语言, 先不管了
有进展么?
目前有没有go库支持GFM的啊
我用的markdown库已经基本兼容GFM的呢
你用的是blackfriday是吧?
blackfriday 目前还有一丝没有兼容.
比如
# text
* item1
* item2
是不行的.
# text
* item1
* item2
才可以 而纯正的GFM是上面两种都可以渲染出list的.
不知道你那边表现如何,还望告知,多谢 :)
就是blackfriday, 其实也就这样了, 纯正的GFM只有ruby版
sundown 的不都是GFM么
sundown是c写的吧..
其实各种实现都有各种坑,因为markdown的规格有各种没考虑到, 对此pandoc的作者专门做了一个网页吐槽 http://johnmacfarlane.net/babelmark2/faq.html
On Thu, Oct 3, 2013 at 8:53 PM, 王超 notifications@github.com wrote:
sundown 的不都是GFM么
— Reply to this email directly or view it on GitHubhttps://github.com/wendal/gor/issues/5#issuecomment-25617768 .
在 sundown 的 readme 里面倒是有推荐了两个 go 写的 markdown解析器,goskirt 跟 upskirt.go,不过不知道效果如何
其实吧, sundown 它自己都已经 deprecated 了。。。
markdown的代码块是通过判断4个空格来显示代码块,不知道现在有无支持GitHub Flavored Markdown那样的
Syntax highlighting
代码块的计划?