刚开始接触markdown的时候,以为好简单好方便,随着使用的深刻,发现markdown好像在不少地方有不少不一样的实现,语法特性各不相同,顿时陷入迷茫。原文:Markdown的各类扩展php
标准markdown的语法:http://daringfireball.net/projects/markdown/syntaxhtml
Markdown的php解析与实现,而且增长了许多有用的扩展。PHP Markdown Extra其中几个比较重要的改进有:git
[Link back to header 1](#header1) Header 1 {#header1} ======== ## Header 2 ## {#header2}
支持元素包括header
、code block
、link
、image
github
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.html #example-1} <p>paragraph <b>emphasis</b> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Function name | Description | | ------------- | ------------------------------ | | `help()` | Display the help window. | | `destroy()` | **Destroy your computer!** |
dl
和dt
在markdown中的对应语法That's some text with a footnote.[^1] [^1]: And that's the footnote.
abbr
在"始做俑者PHP Markdown Extra"后,不少基于Ruby的Markdown解释器开始浮现。其中,Maruku号称:ruby
Maruku的语法详见这里markdown
不过,该项目已经中止维护了。ui
一样是ruby开发的解释器,kramdown吸收了Maruku几乎全部的特色,功能更为强大。其中有特色的功能有:this
^
做为块元素的分隔符RDiscount又是一个基于Ruby开发的解释器,不过它是基于Discount的语法移植的,因此语法规则须要参考Discount。其语法支持几种上面没有提到过的特性:code
<center>

alpha
列表:<ol type='a'></ol>
Redcarpet是一个转化库,能够在标准Markdown的基础上,配置一些额外的功能:
_
不处理~~good~~
<mark></mark>
经过==highlighted==
输出<q></q>
经过"quote"
输出Github Page对于上述的基于Ruby的markdown是支持的,从这里能够看到。另外,Github对于Issue、comments等,还定义了GFM(GitHub Flavored Markdown),其中的语法通常基原本源于上面的提到的东西。除此以外,github还支持一些额外的特性:
- [x] @mentions, #refs, [links](), **formatting**, and <del>tags</del> are supported - [x] list syntax is required (any unordered or ordered list supported) - [x] this is a complete item - [ ] this is an incomplete item