Updated codemirror to 5.4.0

This commit is contained in:
Wu Cheng-Han 2015-07-04 11:31:01 +08:00
parent 1d843c8ac2
commit 01685c255f
69 changed files with 2988 additions and 558 deletions

View file

@ -41,11 +41,11 @@
"[variable-2&formatting&formatting-list&formatting-list-ol 1. ][variable-2 foo]");
FT("formatting_link",
"[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string (][string http://example.com/][string&formatting&formatting-link-string )]");
"[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string&url (][string&url http://example.com/][string&formatting&formatting-link-string&url )]");
FT("formatting_linkReference",
"[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string [][string bar][string&formatting&formatting-link-string ]]]",
"[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string http://example.com/]");
"[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string&url [][string&url bar][string&formatting&formatting-link-string&url ]]]",
"[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string&url http://example.com/]");
FT("formatting_linkWeb",
"[link&formatting&formatting-link <][link http://example.com/][link&formatting&formatting-link >]");
@ -85,13 +85,6 @@
" [comment foo]",
"bar");
// Code blocks using 4 spaces with internal indentation
MT("codeBlocksUsing4SpacesIndentation",
" foo",
" [comment bar]",
" [comment hello]",
" [comment world]");
// Code blocks should end even after extra indented lines
MT("codeBlocksWithTrailingIndentedLine",
" [comment foo]",
@ -104,6 +97,12 @@
MT("codeBlocksUsing1Tab",
"\t[comment foo]");
// No code blocks directly after paragraph
// http://spec.commonmark.org/0.19/#example-65
MT("noCodeBlocksAfterParagraph",
"Foo",
" Bar");
// Inline code using backticks
MT("inlineCodeUsingBackticks",
"foo [comment `bar`]");
@ -166,10 +165,13 @@
MT("atxH6",
"[header&header-6 ###### foo]");
// H6 - 7x '#' should still be H6, per Dingus
// http://daringfireball.net/projects/markdown/dingus
MT("atxH6NotH7",
"[header&header-6 ####### foo]");
// http://spec.commonmark.org/0.19/#example-24
MT("noAtxH7",
"####### foo");
// http://spec.commonmark.org/0.19/#example-25
MT("noAtxH1WithoutSpace",
"#5 bolt");
// Inline styles should be parsed inside headers
MT("atxH1inline",
@ -202,6 +204,25 @@
"foo",
"[header&header-2 ---]");
// http://spec.commonmark.org/0.19/#example-45
MT("setextH2AllowSpaces",
"foo",
" [header&header-2 ---- ]");
// http://spec.commonmark.org/0.19/#example-44
MT("noSetextAfterIndentedCodeBlock",
" [comment foo]",
"[hr ---]");
// http://spec.commonmark.org/0.19/#example-51
MT("noSetextAfterQuote",
"[quote&quote-1 > foo]",
"[hr ---]");
MT("noSetextAfterList",
"[variable-2 - foo]",
"[hr ---]");
// Single-line blockquote with trailing space
MT("blockquoteSpace",
"[quote&quote-1 > foo]");
@ -251,6 +272,13 @@
"",
"hello");
// Header with leading space after continued blockquote (#3287, negative indentation)
MT("headerAfterContinuedBlockquote",
"[quote&quote-1 > foo]",
"[quote&quote-1 bar]",
"",
" [header&header-1 # hello]");
// Check list types
MT("listAsterisk",
@ -287,11 +315,21 @@
"1. bar",
"2. hello");
// List after hr
MT("listAfterHr",
"[hr ---]",
"[variable-2 - bar]");
// List after header
MT("listAfterHeader",
"[header&header-1 # foo]",
"[variable-2 - bar]");
// hr after list
MT("hrAfterList",
"[variable-2 - foo]",
"[hr -----]");
// Formatting in lists (*)
MT("listAsteriskFormatting",
"[variable-2 * ][variable-2&em *foo*][variable-2 bar]",
@ -498,39 +536,39 @@
// Inline link with title
MT("linkTitle",
"[link [[foo]]][string (http://example.com/ \"bar\")] hello");
"[link [[foo]]][string&url (http://example.com/ \"bar\")] hello");
// Inline link without title
MT("linkNoTitle",
"[link [[foo]]][string (http://example.com/)] bar");
"[link [[foo]]][string&url (http://example.com/)] bar");
// Inline link with image
MT("linkImage",
"[link [[][tag ![[foo]]][string (http://example.com/)][link ]]][string (http://example.com/)] bar");
"[link [[][tag ![[foo]]][string&url (http://example.com/)][link ]]][string&url (http://example.com/)] bar");
// Inline link with Em
MT("linkEm",
"[link [[][link&em *foo*][link ]]][string (http://example.com/)] bar");
"[link [[][link&em *foo*][link ]]][string&url (http://example.com/)] bar");
// Inline link with Strong
MT("linkStrong",
"[link [[][link&strong **foo**][link ]]][string (http://example.com/)] bar");
"[link [[][link&strong **foo**][link ]]][string&url (http://example.com/)] bar");
// Inline link with EmStrong
MT("linkEmStrong",
"[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string (http://example.com/)] bar");
"[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string&url (http://example.com/)] bar");
// Image with title
MT("imageTitle",
"[tag ![[foo]]][string (http://example.com/ \"bar\")] hello");
"[tag ![[foo]]][string&url (http://example.com/ \"bar\")] hello");
// Image without title
MT("imageNoTitle",
"[tag ![[foo]]][string (http://example.com/)] bar");
"[tag ![[foo]]][string&url (http://example.com/)] bar");
// Image with asterisks
MT("imageAsterisks",
"[tag ![[*foo*]]][string (http://example.com/)] bar");
"[tag ![[*foo*]]][string&url (http://example.com/)] bar");
// Not a link. Should be normal text due to square brackets being used
// regularly in text, especially in quoted material, and no space is allowed
@ -540,24 +578,24 @@
// Reference-style links
MT("linkReference",
"[link [[foo]]][string [[bar]]] hello");
"[link [[foo]]][string&url [[bar]]] hello");
// Reference-style links with Em
MT("linkReferenceEm",
"[link [[][link&em *foo*][link ]]][string [[bar]]] hello");
"[link [[][link&em *foo*][link ]]][string&url [[bar]]] hello");
// Reference-style links with Strong
MT("linkReferenceStrong",
"[link [[][link&strong **foo**][link ]]][string [[bar]]] hello");
"[link [[][link&strong **foo**][link ]]][string&url [[bar]]] hello");
// Reference-style links with EmStrong
MT("linkReferenceEmStrong",
"[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string [[bar]]] hello");
"[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string&url [[bar]]] hello");
// Reference-style links with optional space separator (per docuentation)
// "You can optionally use a space to separate the sets of brackets"
MT("linkReferenceSpace",
"[link [[foo]]] [string [[bar]]] hello");
"[link [[foo]]] [string&url [[bar]]] hello");
// Should only allow a single space ("...use *a* space...")
MT("linkReferenceDoubleSpace",
@ -565,7 +603,7 @@
// Reference-style links with implicit link name
MT("linkImplicit",
"[link [[foo]]][string [[]]] hello");
"[link [[foo]]][string&url [[]]] hello");
// @todo It would be nice if, at some point, the document was actually
// checked to see if the referenced link exists
@ -573,46 +611,46 @@
// Link label, for reference-style links (taken from documentation)
MT("labelNoTitle",
"[link [[foo]]:] [string http://example.com/]");
"[link [[foo]]:] [string&url http://example.com/]");
MT("labelIndented",
" [link [[foo]]:] [string http://example.com/]");
" [link [[foo]]:] [string&url http://example.com/]");
MT("labelSpaceTitle",
"[link [[foo bar]]:] [string http://example.com/ \"hello\"]");
"[link [[foo bar]]:] [string&url http://example.com/ \"hello\"]");
MT("labelDoubleTitle",
"[link [[foo bar]]:] [string http://example.com/ \"hello\"] \"world\"");
"[link [[foo bar]]:] [string&url http://example.com/ \"hello\"] \"world\"");
MT("labelTitleDoubleQuotes",
"[link [[foo]]:] [string http://example.com/ \"bar\"]");
"[link [[foo]]:] [string&url http://example.com/ \"bar\"]");
MT("labelTitleSingleQuotes",
"[link [[foo]]:] [string http://example.com/ 'bar']");
"[link [[foo]]:] [string&url http://example.com/ 'bar']");
MT("labelTitleParenthese",
"[link [[foo]]:] [string http://example.com/ (bar)]");
"[link [[foo]]:] [string&url http://example.com/ (bar)]");
MT("labelTitleInvalid",
"[link [[foo]]:] [string http://example.com/] bar");
"[link [[foo]]:] [string&url http://example.com/] bar");
MT("labelLinkAngleBrackets",
"[link [[foo]]:] [string <http://example.com/> \"bar\"]");
"[link [[foo]]:] [string&url <http://example.com/> \"bar\"]");
MT("labelTitleNextDoubleQuotes",
"[link [[foo]]:] [string http://example.com/]",
"[link [[foo]]:] [string&url http://example.com/]",
"[string \"bar\"] hello");
MT("labelTitleNextSingleQuotes",
"[link [[foo]]:] [string http://example.com/]",
"[link [[foo]]:] [string&url http://example.com/]",
"[string 'bar'] hello");
MT("labelTitleNextParenthese",
"[link [[foo]]:] [string http://example.com/]",
"[link [[foo]]:] [string&url http://example.com/]",
"[string (bar)] hello");
MT("labelTitleNextMixed",
"[link [[foo]]:] [string http://example.com/]",
"[link [[foo]]:] [string&url http://example.com/]",
"(bar\" hello");
MT("linkWeb",