14

Github “使用” github 风格的降价,但我无法找到它的确切含义。他们在客户端使用什么解析库来呈现预览?

用于 *.md 文件、问题和 wiki 页面的库是否相同?

如果您可以向我指出一个资源,该资源显示了 github 风格的降价和 commonmark 如何重叠以及它们有何不同,则可以加分。

4

2 回答 2

10

向我指出一个资源,该资源显示了 github 风格的降价和 commonmark 如何重叠以及它们有何不同。

现在(2017 年 3 月)正式记录了这一点:请参阅“ GitHub Flavored Markdown 的正式规范

从今天开始,我们网站上托管的所有 Markdown 用户内容,包括用户评论、wiki 和存储库中的 .md 文件,都将按照GitHub Flavored Markdown 的正式规范进行解析和呈现。

这在“ GitHub Flavored Markdown 的正式规范”中有详细说明

此正式规范基于CommonMark,这是一个雄心勃勃的项目,旨在以反映其真实世界使用的方式正式指定 Internet 上许多网站使用的 Markdown 语法。
CommonMark 允许人们以他们一贯的方式继续使用 Markdown,同时为开发人员提供全面的规范和参考实现,以便在平台之间以一致的方式互操作和显示 Markdown。

这个想法是:

Taking the CommonMark spec and re-engineering our current user content stack around it is not a trivial endeavour.
The main issue we struggled with is that the spec (and hence its reference implementations) focuses strictly on the common subset of Markdown that is supported by the original Perl implementation.
This does not include some of the extended features that have been always available on GitHub. Most notably, support for tables, strikethrough, autolinks and task lists are missing.

In order to fully specify the version of Markdown we use at GitHub (known as GFM), we had to formally define the syntax and semantics of these features, something which we had never done before. We did this on top of the existing CommonMark spec, taking special care to ensure that our extensions are a strict and optional superset of the original specification.

于 2017-03-14T22:39:20.087 回答
8

标记是“我们 [Github] 用来呈现 README.your_favorite_markup 的代码”。他们将Redcarpet列为他们的 Markdown 库。反过来,这使用Sundown。我不确定这是否用于所有网站。

它还声称拥有“大规模扩展支持”。

Sundown 可选支持多个(非官方)Markdown 扩展,例如非严格强调、围栏代码块、表格、自动链接、删除线等。

有关完整的详细信息,您可能必须深入研究这些库。

如果您可以向我指出一个资源,该资源显示了 github 风格的降价和 commonmark 如何重叠以及它们有何不同,则可以加分。

Sundown 声称与 Markdown v1.0.0 和 v1.0.3“完全符合标准”,但对于我来说,我找不到这些版本。只有v1.0.1和0.26 的CommonMark

Sundown 开箱即用地通过了官方 Markdown v1.0.0 和 v1.0.3 测试套件,并且已经通过额外的极端案例进行了广泛的测试,以确保其输出在任何时候都尽可能合理。

Github Markdown 扩展记录在他们的 Mastering Markdown 指南中。

于 2016-09-28T20:54:07.837 回答