All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
5 AssertNotEqual SyntaxOf('a'), 'htmlBold'
6 AssertEqual SyntaxOf('b'), 'htmlBold'
7 AssertNotEqual SyntaxOf('c'), 'htmlBold'
13 AssertNotEqual SyntaxOf('a'), 'htmlBold'
14 AssertEqual SyntaxOf('b'), 'htmlBold'
15 AssertNotEqual SyntaxOf('c'), 'htmlBold'
21 AssertNotEqual SyntaxOf('a'), 'htmlItalic'
22 AssertEqual SyntaxOf('b'), 'htmlItalic'
23 AssertNotEqual SyntaxOf('c'), 'htmlItalic'
29 AssertNotEqual SyntaxOf('a'), 'htmlItalic'
30 AssertEqual SyntaxOf('b'), 'htmlItalic'
31 AssertNotEqual SyntaxOf('c'), 'htmlItalic'
36 Execute (not italic with escaped asterisks):
37 AssertNotEqual SyntaxOf('a'), 'htmlItalic'
38 AssertNotEqual SyntaxOf('b'), 'htmlItalic'
39 AssertNotEqual SyntaxOf('c'), 'htmlItalic'
44 Execute (not italic with escaped underscores):
45 AssertNotEqual SyntaxOf('a'), 'htmlItalic'
46 AssertNotEqual SyntaxOf('b'), 'htmlItalic'
47 AssertNotEqual SyntaxOf('c'), 'htmlItalic'
52 Execute (italic with escaped underscores):
53 AssertNotEqual SyntaxOf('a'), 'htmlItalic'
54 AssertEqual SyntaxOf('b'), 'htmlItalic'
55 AssertEqual SyntaxOf('c'), 'htmlItalic'
56 AssertNotEqual SyntaxOf('d'), 'htmlItalic'
61 Execute (italic with escaped asterisks):
62 AssertNotEqual SyntaxOf('a'), 'htmlItalic'
63 AssertEqual SyntaxOf('b'), 'htmlItalic'
64 AssertEqual SyntaxOf('c'), 'htmlItalic'
65 AssertNotEqual SyntaxOf('d'), 'htmlItalic'
70 Execute (bold with escaped underscores):
71 AssertNotEqual SyntaxOf('a'), 'htmlBold'
72 AssertEqual SyntaxOf('b'), 'htmlBold'
73 AssertEqual SyntaxOf('c'), 'htmlBold'
74 AssertNotEqual SyntaxOf('d'), 'htmlBold'
81 Execute (link with title):
82 AssertEqual SyntaxOf('a'), 'mkdLink'
83 AssertEqual SyntaxOf('b'), 'mkdURL'
90 Execute (parenthesis not in link):
91 AssertNotEqual SyntaxOf('a'), 'mkdURL'
92 AssertNotEqual SyntaxOf('b'), 'mkdURL'
97 Execute (multiple links on a line):
98 AssertNotEqual SyntaxOf('c'), 'mkdLink'
99 AssertNotEqual SyntaxOf('c'), 'mkdURL'
104 Execute (space is not allowed between link text and parenthesis):
105 AssertNotEqual SyntaxOf('a'), 'mkdLink'
106 AssertNotEqual SyntaxOf('b'), 'mkdURL'
111 Execute (conceal link):
112 setlocal conceallevel=2
113 AssertEqual synconcealed(1, 1)[0], 1
114 AssertEqual synconcealed(1, 2)[0], 0
115 AssertEqual synconcealed(1, 3)[0], 1
116 AssertEqual synconcealed(1, 4)[0], 1
117 AssertEqual synconcealed(1, 4)[0], 1
118 AssertEqual synconcealed(1, 5)[0], 1
119 AssertEqual synconcealed(1, 6)[0], 1
120 setlocal conceallevel=0
128 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
129 AssertEqual SyntaxOf('<'), 'mkdDelimiter'
130 AssertEqual SyntaxOf('b'), 'mkdInlineURL'
131 AssertEqual SyntaxOf('>'), 'mkdDelimiter'
132 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
137 Execute (autolink with scheme case is insensitive):
138 AssertEqual SyntaxOf('a'), 'mkdInlineURL'
143 Execute (autolink without scheme is not a link):
144 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
152 Execute (autolink with space is not a link):
153 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
154 AssertNotEqual SyntaxOf('b'), 'mkdInlineURL'
155 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
156 AssertNotEqual SyntaxOf('d'), 'mkdInlineURL'
157 AssertNotEqual SyntaxOf('e'), 'mkdInlineURL'
162 Execute (autolinks can be backslash escaped):
163 AssertNotEqual SyntaxOf('<'), 'mkdDelimiter'
168 Execute (autolink in parenthesis):
169 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
170 AssertEqual SyntaxOf('('), 'mkdDelimiter'
171 AssertEqual SyntaxOf('b'), 'mkdInlineURL'
172 AssertEqual SyntaxOf(')'), 'mkdDelimiter'
173 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
176 [![a](http://b)](http://c)
178 Execute (autolink in link text):
179 AssertEqual SyntaxOf('!'), 'mkdDelimiter'
180 AssertEqual SyntaxOf('a'), 'mkdLink'
181 AssertEqual SyntaxOf('b'), 'mkdURL'
182 AssertEqual SyntaxOf('c'), 'mkdURL'
191 Execute (code blocks can be fenced with tildes):
192 AssertEqual SyntaxOf('c'), 'mkdCode'
199 Execute (code blocks can be fenced with tildes longer than 3):
200 AssertEqual SyntaxOf('c'), 'mkdCode'
207 Execute (code blocks can be fenced with backticks longer than 3):
208 AssertEqual SyntaxOf('c'), 'mkdCode'
215 Execute (code blocks can have a language specifier):
216 AssertEqual SyntaxOf('c'), 'mkdCode'
225 Execute (code blocks can be fenced with backticks and a language specifier):
226 AssertEqual SyntaxOf('code'), 'mkdCode'
227 AssertNotEqual SyntaxOf('text'), 'mkdCode'
237 Execute (indent code blocks):
238 AssertNotEqual SyntaxOf('a'), 'mkdCode'
239 AssertEqual SyntaxOf('b'), 'mkdCode'
240 AssertEqual SyntaxOf('c'), 'mkdCode'
249 Execute (indent code blocks after header):
250 AssertNotEqual SyntaxOf('a'), 'mkdCode'
251 AssertNotEqual SyntaxOf('b'), 'mkdCode'
252 AssertEqual SyntaxOf('c'), 'mkdCode'
261 Execute (indent code blocks after list):
262 AssertNotEqual SyntaxOf('a'), 'mkdCode'
263 AssertNotEqual SyntaxOf('b'), 'mkdCode'
264 AssertEqual SyntaxOf('c'), 'mkdCode'
270 Execute (indent code block at beginning of file):
271 AssertEqual SyntaxOf('a'), 'mkdCode'
272 AssertEqual SyntaxOf('b'), 'mkdCode'
285 Execute (fenced code block syntax with a language specifier):
286 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
288 AssertEqual SyntaxOf('include'), 'cInclude'
289 AssertEqual SyntaxOf('code'), 'mkdSnippetCPP'
290 AssertEqual SyntaxOf('def'), 'rubyDefine'
297 Execute (fenced code block syntax with an unknown language specifier):
298 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
300 AssertEqual SyntaxOf('code'), 'mkdSnippetA_B_'
310 Execute (first = or - in fenced code block is not setex headers):
311 AssertEqual SyntaxOf('='), 'mkdCode'
312 AssertEqual SyntaxOf('-'), 'mkdCode'
323 AssertNotEqual SyntaxOf('x'), 'mkdMath'
324 AssertNotEqual SyntaxOf('y'), 'mkdMath'
325 let g:vim_markdown_math=1
327 AssertNotEqual SyntaxOf('a'), 'mkdMath'
328 AssertNotEqual SyntaxOf('b'), 'mkdMath'
329 AssertNotEqual SyntaxOf('c'), 'mkdMath'
330 AssertNotEqual SyntaxOf('d'), 'mkdMath'
331 AssertNotEqual SyntaxOf('e'), 'mkdMath'
332 AssertNotEqual SyntaxOf('f'), 'mkdMath'
333 AssertEqual SyntaxOf('x'), 'mkdMath'
334 AssertEqual SyntaxOf('y'), 'mkdMath'
335 let g:vim_markdown_math=0
337 AssertNotEqual SyntaxOf('x'), 'mkdMath'
338 AssertNotEqual SyntaxOf('y'), 'mkdMath'
349 Execute (multiline math):
350 let g:vim_markdown_math=1
352 AssertNotEqual SyntaxOf('a'), 'mkdMath'
353 AssertEqual SyntaxOf('b'), 'mkdMath'
354 AssertNotEqual SyntaxOf('c'), 'mkdMath'
360 Execute (math tex highlighting):
361 let g:vim_markdown_math=0
363 AssertNotEqual SyntaxOf('sqrt'), 'texStatement'
364 AssertNotEqual SyntaxOf('frac'), 'texStatement'
365 let g:vim_markdown_math=1
367 AssertEqual SyntaxOf('sqrt'), 'texStatement'
368 AssertEqual SyntaxOf('frac'), 'texStatement'
377 Execute (YAML frontmatter is controlled by the option):
378 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
379 let g:vim_markdown_frontmatter=1
381 AssertEqual SyntaxOf('a'), 'yamlBlockMappingKey'
382 let g:vim_markdown_frontmatter=0
384 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
392 Execute (YAML frontmatter only works if it's the first thing in the file):
393 let g:vim_markdown_frontmatter=1
395 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
404 Execute (rules are not mistaken by YAML frontmatter delimiters):
405 let g:vim_markdown_frontmatter=1
407 AssertEqual SyntaxAt(5, 1), 'mkdRule'
418 Execute (header title starts with #):
419 AssertEqual SyntaxOf('a'), 'htmlH1'
420 AssertEqual SyntaxOf('b'), 'htmlH2'
435 ## h2 trailing hash ##
441 ### h3 trailing hash ###
449 Execute (atx headers):
450 AssertEqual SyntaxOf('# h1 space'), 'htmlH1'
451 AssertEqual SyntaxOf('#h1 nospace'), 'htmlH1'
452 AssertEqual SyntaxOf('# h1 2 spaces'), 'htmlH1'
453 AssertEqual SyntaxOf('# h1 trailing hash #'), 'htmlH1'
454 AssertEqual SyntaxOf('## h2 space'), 'htmlH2'
455 AssertEqual SyntaxOf('##h2 nospace'), 'htmlH2'
456 AssertEqual SyntaxOf('## h2 trailing hash ##'), 'htmlH2'
457 AssertEqual SyntaxOf('### h3 space'), 'htmlH3'
458 AssertEqual SyntaxOf('###h3 nospace'), 'htmlH3'
459 AssertEqual SyntaxOf('### h3 trailing hash ###'), 'htmlH3'
460 AssertEqual SyntaxOf('#### h4'), 'htmlH4'
461 AssertEqual SyntaxOf('##### h5'), 'htmlH5'
462 AssertEqual SyntaxOf('###### h6'), 'htmlH6'
471 Execute (atx headers relative positions):
472 AssertEqual SyntaxOf('# h1 before h2'), 'htmlH1'
473 AssertEqual SyntaxOf('## h2 between h1s'), 'htmlH2'
474 AssertEqual SyntaxOf('# h1 after h2'), 'htmlH1'
483 setex h1 single punctuation
486 setex h1 punctuation longer than header
487 ================================
489 Execute (setex headers):
490 AssertEqual SyntaxOf('setex h1'), 'htmlH1'
491 AssertEqual SyntaxOf('^========$'), 'htmlH1'
492 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
493 AssertEqual SyntaxOf('--------'), 'htmlH2'
494 AssertEqual SyntaxOf('setex h1 single punctuation'), 'htmlH1'
495 AssertEqual SyntaxOf('^=$'), 'htmlH1'
496 AssertEqual SyntaxOf('setex h1 punctuation longer than header'), 'htmlH1'
497 AssertEqual SyntaxOf('^================================$'), 'htmlH1'
503 Execute (prevent list vs Setex confusion):
504 AssertNotEqual SyntaxOf('- not Setex'), 'htmlH2'
505 AssertNotEqual SyntaxOf('- becuase list'), 'htmlH2'
522 Execute (mixed atx and setex headers):
523 AssertEqual SyntaxOf('setex h1 before atx'), 'htmlH1'
524 AssertEqual SyntaxOf('==================='), 'htmlH1'
525 AssertEqual SyntaxOf('## atx h2'), 'htmlH2'
526 AssertEqual SyntaxOf('### atx h3'), 'htmlH3'
527 AssertEqual SyntaxOf('# atx h1'), 'htmlH1'
528 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
529 AssertEqual SyntaxOf('------------------'), 'htmlH2'
537 Execute (& and > are not marked as htmlError in lists):
538 AssertEqual SyntaxOf('-'), 'mkdListItem'
539 AssertEqual SyntaxOf('1.'), 'mkdListItem'
540 AssertNotEqual SyntaxOf('&'), 'htmlError'
541 AssertNotEqual SyntaxOf('>'), 'htmlError'
552 Execute (HTML tag in text):
553 AssertEqual SyntaxOf('p'), 'htmlTagName'
554 AssertEqual SyntaxOf('<p>'), 'htmlTag'
555 AssertEqual SyntaxOf('</p>'), 'htmlEndTag'
556 AssertEqual SyntaxOf('span'), 'htmlTagName'
557 AssertEqual SyntaxOf('<span>'), 'htmlTag'
558 AssertEqual SyntaxOf('</span>'), 'htmlEndTag'