【经验总结】Markdown 语法测试用例集

kevin_sz

共 3158字,需浏览 7分钟

 · 2016-08-14

测试用例1:链接

kevin_sz 创建的这个测试页面.

测试用例2:无格式文本段落

这是一个普通段落。
无格式文本段落。

测试用例3:表格

Foo1 Foo2 Foo3 Foo4
Fou1 Fou2 Fou3 Fou4

测试用例4:段落穿插

这是另一个普通段落。
这是一个无格式文本段落

测试用例5:链接

http://images.google.com/images?num=30&q=larry+bird

测试用例6:版权符号

©

测试用例7:分割线和各级标题

This is an H1

This is an H2

分割线


分割线


分割线


分割线


分割线

分割线

这是 H1

这是 H2

这是 H6

这是 H1

这是 H2

这是 H3

测试用例7:区块引用,二级引用,引用中插入标题,引用中插入分割线,引用中的列表,代码快标识

This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.

Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
id sem consectetuer libero luctus adipiscing.

This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.

Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
id sem consectetuer libero luctus adipiscing.

This is the first level of quoting.

This is nested blockquote.

Back to the first level.

这是一个标题。下面是列表

  1. 这是第一行列表项。
  2. 这是第二行列表项。

给出一些例子代码(用四个空格标识代码段):

return shell_exec("echo $input | $markdown_script");

测试用例8:列表测试:加好、星号、减号是无需列表; 数字+点是有序列表(根据数字排序)

  • Red
  • Green
  • Blue
  1. Bird
  2. McHale
  3. Parish
  • Red
  • Green
  • Blue
  1. Bird
  2. Parish
  3. McHale

测试用例9:HTML支持的列表和普通短路以及代码块

  1. Bird
  2. McHale
  3. Parish

这是一个普通段落:

这是一个代码区块。

测试用例10:4个空格标识代码段

Here is an example of AppleScript:

tell application "Foo"
    beep
end tell

测试用例11:列表(*)中放区块引用(>),放入代码引用(8个空格)。一个代码区块会一直持续到没有缩进的那一行(或是文件结尾)。

  • A list item with a blockquote:

    This is a blockquote
    inside a list item.

  • B list item with a blockquote:

    This is a blockquote
    inside a list item.

  • C list item with code area:
    define function()
    { this is python code example
           print "hello world"

    }

测试用例12:链接

要建立一个行内式的链接,只要在方块括号后面紧接着圆括号并插入网址链接即可,如果你还想要加上链接的 title 文字(鼠标在链接上时的悬浮提示),只要在网址后面,用双引号把 title 文字包起来即可,
This is an example inline link.
This link has no title attribute.

参考式的链接是在链接文字的括号后面再接上另一个方括号,而在第二个方括号里面要填入用以辨识链接的标记:
This is an example reference-style link.
你也可以选择性地在两个方括号中间加上一个空格:
This is an example reference-style link.
接着,在文件的任意处,你可以把这个标记的链接内容定义出来:

"Optional Title Here"

I get 10 times more traffic from Google than from
Yahoo or MSN.

I get 10 times more traffic from Google
than from Yahoo or
MSN.

测试用例13:强调:

Markdown 使用星号()和底线(_)作为标记强调字词的符号,被 包围的字词会被转成用 标签包围,用两个 * 或 包起来的话,则会被转成

single asterisks
single underscores

double asterisks
double underscores

*this text is surrounded by literal asterisks*

Use the printf() function.
There is a literal backtick (`) here.

A single backtick in a code span: `
A backtick-delimited string in a code span: `foo`
lease don't use any tags.

测试用例14:插入图片:

详细叙述如下:

  1. 一个惊叹号 !
  2. 接着一个方括号,里面放上图片的替代文字
  3. 接着一个普通括号,里面放上图片的网址,最后还可以用引号包住并加上 选择性的 'title' 文字。

91088343333@qq.com

*literal asterisks*

测试用例15:插入视频:



Your user agent does not support the HTML5 Video element.

Idina Menze和Caleb Hyles激情对唱Let It Go:

Let It Go

测试用例16:用反斜杠插入普通字符

\ 反斜线
` 反引号
* 星号
_ 底线
{} 花括号
[] 方括号
() 括弧
# 井字号
+ 加号
- 减号
. 英文句点
! 惊叹号

浏览 81
点赞
评论
收藏
分享

手机扫一扫分享

举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

举报