剛開始接觸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>
![dust mite](http://dust.mite =150x150)
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