本文地址:https://blog.csdn.net/qq_28550263/article/details/128735962
1. 什么是 CommonMark
Markdown 的作者 John Gruber 对 Markdown 语法的规范描述并没有明确指定语法。在没有规范的情况下,早期的实现者参考了原始代码来解决这些歧义。但是它非常有问题,并且在许多情况下给出了明显不好的结果,因此它不是规格的令人满意的替代品。
由于没有明确的规范,因此在过去 10 年中,实现方式差异很大。因此,用户经常惊讶地发现,在一个系统(例如,GitHub wiki)上以一种方式呈现的文档在另一个系统上呈现方式不同(例如,使用 Pandoc 转换为文档手册)。更糟糕的是,由于 Markdown 中没有任何内容被视为“语法错误”,因此通常不会立即发现分歧。
CommonMark 为 Markdown 提出了一个标准的、明确的语法规范,以及一套全面的测试来验证 Markdown 实现是否符合这个规范。