Giter VIP home page Giter VIP logo

Comments (20)

wendal avatar wendal commented on July 30, 2024

呵呵,有难度, 必要性不高呢

这需要另外写一个markdown渲染器

from gor.

wendal avatar wendal commented on July 30, 2024

貌似 go get github.com/russross/blackfriday 就支持

from gor.

ywjno avatar ywjno commented on July 30, 2024

等我找台机器试试

from gor.

wendal avatar wendal commented on July 30, 2024

我的意思是更改markdown渲染库

from gor.

ywjno avatar ywjno commented on July 30, 2024

你就不给我一个pull request的机会

from gor.

wendal avatar wendal commented on July 30, 2024

呵呵,那你来试试呗, 两个markdown的API不太一样

from gor.

ywjno avatar ywjno commented on July 30, 2024

我试了一下貌似搞不定。。。

from gor.

wendal avatar wendal commented on July 30, 2024

markdown的操作,都在markdown.go里面的

from gor.

ywjno avatar ywjno commented on July 30, 2024
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
```

这样的代码高亮

from gor.

wendal avatar wendal commented on July 30, 2024

我试试

from gor.

wendal avatar wendal commented on July 30, 2024

更换markdown库了

from gor.

ywjno avatar ywjno commented on July 30, 2024

great

from gor.

wendal avatar wendal commented on July 30, 2024

貌似还不是不能按语言, 先不管了

from gor.

athom avatar athom commented on July 30, 2024

有进展么?

目前有没有go库支持GFM的啊

from gor.

wendal avatar wendal commented on July 30, 2024

我用的markdown库已经基本兼容GFM的呢

from gor.

athom avatar athom commented on July 30, 2024

你用的是blackfriday是吧?

blackfriday 目前还有一丝没有兼容.

比如

# text
* item1
* item2

是不行的.

# text

* item1
* item2

才可以
而纯正的GFM是上面两种都可以渲染出list的.

不知道你那边表现如何,还望告知,多谢 :)

from gor.

wendal avatar wendal commented on July 30, 2024

就是blackfriday, 其实也就这样了, 纯正的GFM只有ruby版

from gor.

hit9 avatar hit9 commented on July 30, 2024

sundown 的不都是GFM么

from gor.

athom avatar athom commented on July 30, 2024

sundown是c写的吧..

其实各种实现都有各种坑,因为markdown的规格有各种没考虑到,
对此pandoc的作者专门做了一个网页吐槽
http://johnmacfarlane.net/babelmark2/faq.html

On Thu, Oct 3, 2013 at 8:53 PM, 王超 [email protected] wrote:

sundown 的不都是GFM么


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-25617768
.

from gor.

ywjno avatar ywjno commented on July 30, 2024

sundown 的 readme 里面倒是有推荐了两个 go 写的 markdown解析器,goskirtupskirt.go,不过不知道效果如何

其实吧, sundown 它自己都已经 deprecated 了。。。

from gor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.