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'
277 Execute (fenced code block syntax with a language specifier):
278 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
280 AssertEqual SyntaxOf('include'), 'cInclude'
281 AssertEqual SyntaxOf('code'), 'mkdSnippetCPP'
282 AssertEqual SyntaxOf('def'), 'rubyDefine'
289 Execute (fenced code block syntax with an unknown language specifier):
290 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
292 AssertEqual SyntaxOf('code'), 'mkdSnippetA_B_'
302 Execute (first = or - in fenced code block is not setex headers):
303 AssertEqual SyntaxOf('='), 'mkdCode'
304 AssertEqual SyntaxOf('-'), 'mkdCode'
315 AssertNotEqual SyntaxOf('x'), 'mkdMath'
316 AssertNotEqual SyntaxOf('y'), 'mkdMath'
317 let g:vim_markdown_math=1
319 AssertNotEqual SyntaxOf('a'), 'mkdMath'
320 AssertNotEqual SyntaxOf('b'), 'mkdMath'
321 AssertNotEqual SyntaxOf('c'), 'mkdMath'
322 AssertNotEqual SyntaxOf('d'), 'mkdMath'
323 AssertNotEqual SyntaxOf('e'), 'mkdMath'
324 AssertNotEqual SyntaxOf('f'), 'mkdMath'
325 AssertEqual SyntaxOf('x'), 'mkdMath'
326 AssertEqual SyntaxOf('y'), 'mkdMath'
327 let g:vim_markdown_math=0
329 AssertNotEqual SyntaxOf('x'), 'mkdMath'
330 AssertNotEqual SyntaxOf('y'), 'mkdMath'
341 Execute (multiline math):
342 let g:vim_markdown_math=1
344 AssertNotEqual SyntaxOf('a'), 'mkdMath'
345 AssertEqual SyntaxOf('b'), 'mkdMath'
346 AssertNotEqual SyntaxOf('c'), 'mkdMath'
352 Execute (math tex highlighting):
353 let g:vim_markdown_math=0
355 AssertNotEqual SyntaxOf('sqrt'), 'texStatement'
356 AssertNotEqual SyntaxOf('frac'), 'texStatement'
357 let g:vim_markdown_math=1
359 AssertEqual SyntaxOf('sqrt'), 'texStatement'
360 AssertEqual SyntaxOf('frac'), 'texStatement'
369 Execute (YAML frontmatter is controlled by the option):
370 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
371 let g:vim_markdown_frontmatter=1
373 AssertEqual SyntaxOf('a'), 'yamlBlockMappingKey'
374 let g:vim_markdown_frontmatter=0
376 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
384 Execute (YAML frontmatter only works if it's the first thing in the file):
385 let g:vim_markdown_frontmatter=1
387 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
396 Execute (rules are not mistaken by YAML frontmatter delimiters):
397 let g:vim_markdown_frontmatter=1
399 AssertEqual SyntaxAt(5, 1), 'mkdRule'
410 Execute (header title starts with #):
411 AssertEqual SyntaxOf('a'), 'htmlH1'
412 AssertEqual SyntaxOf('b'), 'htmlH2'
427 ## h2 trailing hash ##
433 ### h3 trailing hash ###
441 Execute (atx headers):
442 AssertEqual SyntaxOf('# h1 space'), 'htmlH1'
443 AssertEqual SyntaxOf('#h1 nospace'), 'htmlH1'
444 AssertEqual SyntaxOf('# h1 2 spaces'), 'htmlH1'
445 AssertEqual SyntaxOf('# h1 trailing hash #'), 'htmlH1'
446 AssertEqual SyntaxOf('## h2 space'), 'htmlH2'
447 AssertEqual SyntaxOf('##h2 nospace'), 'htmlH2'
448 AssertEqual SyntaxOf('## h2 trailing hash ##'), 'htmlH2'
449 AssertEqual SyntaxOf('### h3 space'), 'htmlH3'
450 AssertEqual SyntaxOf('###h3 nospace'), 'htmlH3'
451 AssertEqual SyntaxOf('### h3 trailing hash ###'), 'htmlH3'
452 AssertEqual SyntaxOf('#### h4'), 'htmlH4'
453 AssertEqual SyntaxOf('##### h5'), 'htmlH5'
454 AssertEqual SyntaxOf('###### h6'), 'htmlH6'
463 Execute (atx headers relative positions):
464 AssertEqual SyntaxOf('# h1 before h2'), 'htmlH1'
465 AssertEqual SyntaxOf('## h2 between h1s'), 'htmlH2'
466 AssertEqual SyntaxOf('# h1 after h2'), 'htmlH1'
475 setex h1 single punctuation
478 setex h1 punctuation longer than header
479 ================================
481 Execute (setex headers):
482 AssertEqual SyntaxOf('setex h1'), 'htmlH1'
483 AssertEqual SyntaxOf('^========$'), 'htmlH1'
484 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
485 AssertEqual SyntaxOf('--------'), 'htmlH2'
486 AssertEqual SyntaxOf('setex h1 single punctuation'), 'htmlH1'
487 AssertEqual SyntaxOf('^=$'), 'htmlH1'
488 AssertEqual SyntaxOf('setex h1 punctuation longer than header'), 'htmlH1'
489 AssertEqual SyntaxOf('^================================$'), 'htmlH1'
495 Execute (prevent list vs Setex confusion):
496 AssertNotEqual SyntaxOf('- not Setex'), 'htmlH2'
497 AssertNotEqual SyntaxOf('- becuase list'), 'htmlH2'
514 Execute (mixed atx and setex headers):
515 AssertEqual SyntaxOf('setex h1 before atx'), 'htmlH1'
516 AssertEqual SyntaxOf('==================='), 'htmlH1'
517 AssertEqual SyntaxOf('## atx h2'), 'htmlH2'
518 AssertEqual SyntaxOf('### atx h3'), 'htmlH3'
519 AssertEqual SyntaxOf('# atx h1'), 'htmlH1'
520 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
521 AssertEqual SyntaxOf('------------------'), 'htmlH2'
529 Execute (& and > are not marked as htmlError in lists):
530 AssertEqual SyntaxOf('-'), 'mkdListItem'
531 AssertEqual SyntaxOf('1.'), 'mkdListItem'
532 AssertNotEqual SyntaxOf('&'), 'htmlError'
533 AssertNotEqual SyntaxOf('>'), 'htmlError'
544 Execute (HTML tag in text):
545 AssertEqual SyntaxOf('p'), 'htmlTagName'
546 AssertEqual SyntaxOf('<p>'), 'htmlTag'
547 AssertEqual SyntaxOf('</p>'), 'htmlEndTag'
548 AssertEqual SyntaxOf('span'), 'htmlTagName'
549 AssertEqual SyntaxOf('<span>'), 'htmlTag'
550 AssertEqual SyntaxOf('</span>'), 'htmlEndTag'