gpt4 book ai didi

github - Github 用什么库来解析 markdown?

转载 作者:行者123 更新时间:2023-12-04 06:16:02 25 4
gpt4 key购买 nike

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

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

如果你能给我指出一个资源,该资源展示了 github 风格的 Markdown 和 commonmark 如何重叠以及它们有什么不同,则加分。

最佳答案

point me to a resource that shows how github flavored markdown and commonmark overlap and how they are different.



现在(2017 年 3 月)正式记录在案:参见“ A formal spec for GitHub Flavored Markdown

Starting today, all Markdown user content hosted in our website, including user comments, wikis, and .md files in repositories will be parsed and rendered following a formal specification for GitHub Flavored Markdown.



这在“ A formal spec for GitHub Flavored Markdown”中有详细说明

This formal specification is based on CommonMark, an ambitious project to formally specify the Markdown syntax used by many websites on the internet in a way that reflects its real world usage.
CommonMark allows people to continue using Markdown the same way they always have, while offering developers a comprehensive specification and reference implementations to interoperate and display Markdown in a consistent way between platforms.



这个想法是:

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.

关于github - Github 用什么库来解析 markdown?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39560644/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com