Skip to content

Commit 60ea990

Browse files
author
Jiang Shang
committed
init
1 parent 00fb77f commit 60ea990

File tree

426 files changed

+29233
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

426 files changed

+29233
-0
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
为何要写这样一个解析器
2+
======================
3+
4+
Markdown已经面世许多年了,国内外许多大大小小的网站都在用它,但是它的解析器却依然混乱不堪。SegmentFault 是中国较大规模使用 Markdown 语法的网站,我们一直在使用一些开源类库,包括但不限于
5+
6+
1. [php-markdown](https://github.com/michelf/php-markdown)
7+
2. [CommonMark for PHP](https://github.com/thephpleague/commonmark)
8+
3. [Parsedown](https://github.com/erusev/parsedown)
9+
10+
他们都有或多或少的毛病,有的性能较差,有的代码比较业余,更多的情况是由于Markdown本身解析比较复杂,因此我们几乎无法去维护另外一个人写的代码。基于这个原因,我为 SegmentFault 专门编写了这么一个Markdown解析器。
11+
12+
使用方法
13+
--------
14+
15+
与常规的解析类库没有任何区别
16+
17+
```php
18+
$parser = new HyperDown\Parser;
19+
$html = $parser->makeHtml($text);
20+
```
21+
22+
当前支持的语法
23+
--------------
24+
25+
- 标题
26+
- 列表(可递归)
27+
- 引用(可递归)
28+
- 缩进风格的代码块
29+
- Github风格的代码块
30+
- 各种行内文字加粗,斜体等效果
31+
- 链接,图片
32+
- 自动链接
33+
- 段内折行
34+
- 脚标
35+
- 分隔符
36+
- 表格
37+
38+
即将支持的语法
39+
--------------
40+
41+
- 图片和链接支持互相套用
42+

0 commit comments

Comments
 (0)