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 (italic text has underscores):
37 AssertEqual SyntaxOf('a'), 'htmlItalic'
38 AssertEqual SyntaxOf('b'), 'htmlItalic'
43 Execute (not italic with escaped asterisks):
44 AssertNotEqual SyntaxOf('a'), 'htmlItalic'
45 AssertNotEqual SyntaxOf('b'), 'htmlItalic'
46 AssertNotEqual SyntaxOf('c'), 'htmlItalic'
51 Execute (not italic with escaped underscores):
52 AssertNotEqual SyntaxOf('a'), 'htmlItalic'
53 AssertNotEqual SyntaxOf('b'), 'htmlItalic'
54 AssertNotEqual SyntaxOf('c'), 'htmlItalic'
59 Execute (italic with escaped underscores):
60 AssertNotEqual SyntaxOf('a'), 'htmlItalic'
61 AssertEqual SyntaxOf('b'), 'htmlItalic'
62 AssertEqual SyntaxOf('c'), 'htmlItalic'
63 AssertNotEqual SyntaxOf('d'), 'htmlItalic'
68 Execute (not italic underscores within text):
69 AssertNotEqual SyntaxOf('a'), 'htmlItalic'
70 AssertNotEqual SyntaxOf('b'), 'htmlItalic'
71 AssertNotEqual SyntaxOf('c'), 'htmlItalic'
76 Execute (italic with escaped asterisks):
77 AssertNotEqual SyntaxOf('a'), 'htmlItalic'
78 AssertEqual SyntaxOf('b'), 'htmlItalic'
79 AssertEqual SyntaxOf('c'), 'htmlItalic'
80 AssertNotEqual SyntaxOf('d'), 'htmlItalic'
85 Execute (bold with escaped underscores):
86 AssertNotEqual SyntaxOf('a'), 'htmlBold'
87 AssertEqual SyntaxOf('b'), 'htmlBold'
88 AssertEqual SyntaxOf('c'), 'htmlBold'
89 AssertNotEqual SyntaxOf('d'), 'htmlBold'
95 Execute (italic with underscores in multiple lines):
96 AssertEqual SyntaxOf('a'), 'htmlItalic'
97 AssertEqual SyntaxOf('b'), 'htmlItalic'
98 AssertEqual SyntaxOf('c'), 'htmlItalic'
99 AssertNotEqual SyntaxOf('d'), 'htmlItalic'
105 Execute (bold with underscores in multiple lines):
106 AssertEqual SyntaxOf('a'), 'htmlBold'
107 AssertEqual SyntaxOf('b'), 'htmlBold'
108 AssertEqual SyntaxOf('c'), 'htmlBold'
109 AssertNotEqual SyntaxOf('d'), 'htmlBold'
115 Execute (bold italic with underscores in multiple lines):
116 AssertEqual SyntaxOf('a'), 'htmlBoldItalic'
117 AssertEqual SyntaxOf('b'), 'htmlBoldItalic'
118 AssertEqual SyntaxOf('c'), 'htmlBoldItalic'
119 AssertNotEqual SyntaxOf('d'), 'htmlBoldItalic'
125 Execute (italic with asterisks in multiple lines):
126 AssertEqual SyntaxOf('a'), 'htmlItalic'
127 AssertEqual SyntaxOf('b'), 'htmlItalic'
128 AssertEqual SyntaxOf('c'), 'htmlItalic'
129 AssertNotEqual SyntaxOf('d'), 'htmlItalic'
135 Execute (bold with asterisks in multiple lines):
136 AssertEqual SyntaxOf('a'), 'htmlBold'
137 AssertEqual SyntaxOf('b'), 'htmlBold'
138 AssertEqual SyntaxOf('c'), 'htmlBold'
139 AssertNotEqual SyntaxOf('d'), 'htmlBold'
145 Execute (bold italic with asterisks in multiple lines):
146 AssertEqual SyntaxOf('a'), 'htmlBoldItalic'
147 AssertEqual SyntaxOf('b'), 'htmlBoldItalic'
148 AssertEqual SyntaxOf('c'), 'htmlBoldItalic'
149 AssertNotEqual SyntaxOf('d'), 'htmlBoldItalic'
156 Execute (link with title):
157 AssertEqual SyntaxOf('a'), 'mkdLink'
158 AssertEqual SyntaxOf('b'), 'mkdURL'
164 Execute (link text with newline):
165 AssertEqual SyntaxOf('a'), 'mkdLink'
166 AssertEqual SyntaxOf('b'), 'mkdLink'
167 AssertEqual SyntaxOf('c'), 'mkdURL'
174 Execute (parenthesis not in link):
175 AssertNotEqual SyntaxOf('a'), 'mkdURL'
176 AssertNotEqual SyntaxOf('b'), 'mkdURL'
181 Execute (multiple links on a line):
182 AssertNotEqual SyntaxOf('c'), 'mkdLink'
183 AssertNotEqual SyntaxOf('c'), 'mkdURL'
188 Execute (space is not allowed between link text and parenthesis):
189 AssertNotEqual SyntaxOf('a'), 'mkdLink'
190 AssertNotEqual SyntaxOf('b'), 'mkdURL'
195 Execute (conceal link):
197 setlocal conceallevel=2
198 AssertEqual synconcealed(1, 1)[0], 1
199 AssertEqual synconcealed(1, 2)[0], 0
200 AssertEqual synconcealed(1, 3)[0], 1
201 AssertEqual synconcealed(1, 4)[0], 1
202 AssertEqual synconcealed(1, 4)[0], 1
203 AssertEqual synconcealed(1, 5)[0], 1
204 AssertEqual synconcealed(1, 6)[0], 1
205 setlocal conceallevel=0
214 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
215 AssertEqual SyntaxOf('<'), 'mkdDelimiter'
216 AssertEqual SyntaxOf('b'), 'mkdInlineURL'
217 AssertEqual SyntaxOf('>'), 'mkdDelimiter'
218 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
223 Execute (autolink with domain starting with a number):
224 AssertEqual SyntaxOf('12monkeys'), 'mkdInlineURL'
229 Execute (autolink with scheme case is insensitive):
230 AssertEqual SyntaxOf('a'), 'mkdInlineURL'
235 Execute (autolink without scheme is not a link):
236 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
244 Execute (autolink with space is not a link):
245 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
246 AssertNotEqual SyntaxOf('b'), 'mkdInlineURL'
247 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
248 AssertNotEqual SyntaxOf('d'), 'mkdInlineURL'
249 AssertNotEqual SyntaxOf('e'), 'mkdInlineURL'
254 Execute (autolinks can be backslash escaped):
255 AssertNotEqual SyntaxOf('<'), 'mkdDelimiter'
260 Execute (autolink in parenthesis):
261 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
262 AssertEqual SyntaxOf('('), 'mkdDelimiter'
263 AssertEqual SyntaxOf('b'), 'mkdInlineURL'
264 AssertEqual SyntaxOf(')'), 'mkdDelimiter'
265 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
268 [![a](http://b)](http://c)
270 Execute (autolink in link text):
271 AssertEqual SyntaxOf('!'), 'mkdDelimiter'
272 AssertEqual SyntaxOf('a'), 'mkdLink'
273 AssertEqual SyntaxOf('b'), 'mkdURL'
274 AssertEqual SyntaxOf('c'), 'mkdURL'
283 Execute (code blocks can be fenced with tildes):
284 AssertEqual SyntaxOf('c'), 'mkdCode'
291 Execute (code blocks can be fenced with tildes longer than 3):
292 AssertEqual SyntaxOf('c'), 'mkdCode'
299 Execute (code blocks can be fenced with backticks longer than 3):
300 AssertEqual SyntaxOf('c'), 'mkdCode'
307 Execute (code blocks can have a language specifier):
308 AssertEqual SyntaxOf('c'), 'mkdCode'
317 Execute (code blocks can be fenced with backticks and a language specifier):
318 AssertEqual SyntaxOf('code'), 'mkdCode'
319 AssertNotEqual SyntaxOf('text'), 'mkdCode'
329 Execute (indent code blocks):
330 AssertNotEqual SyntaxOf('a'), 'mkdCode'
331 AssertEqual SyntaxOf('b'), 'mkdCode'
332 AssertEqual SyntaxOf('c'), 'mkdCode'
341 Execute (indent code blocks after header):
342 AssertNotEqual SyntaxOf('a'), 'mkdCode'
343 AssertNotEqual SyntaxOf('b'), 'mkdCode'
344 AssertEqual SyntaxOf('c'), 'mkdCode'
353 Execute (indent code blocks after list):
354 AssertNotEqual SyntaxOf('a'), 'mkdCode'
355 AssertNotEqual SyntaxOf('b'), 'mkdCode'
356 AssertEqual SyntaxOf('c'), 'mkdCode'
362 Execute (indent code block at beginning of file):
363 AssertEqual SyntaxOf('a'), 'mkdCode'
364 AssertEqual SyntaxOf('b'), 'mkdCode'
377 Execute (fenced code block syntax with a language specifier):
378 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
380 AssertEqual SyntaxOf('include'), 'cInclude'
381 AssertEqual SyntaxOf('code'), 'mkdSnippetCPP'
382 AssertEqual SyntaxOf('def'), 'rubyDefine'
393 Execute (fenced code block syntax with alias language specifier):
394 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
396 AssertEqual SyntaxOf('g:a'), 'vimVar'
397 AssertEqual SyntaxOf('g:b'), 'vimVar'
404 Execute (fenced code block syntax with an unknown language specifier):
405 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
407 AssertEqual SyntaxOf('code'), 'mkdSnippetA_B_'
416 Execute (first = or - in fenced code block is not setex headers):
417 AssertEqual SyntaxOf('='), 'mkdCode'
418 AssertEqual SyntaxOf('-'), 'mkdCode'
425 Execute (fenced code block with extended info strings):
426 AssertEqual SyntaxOf('a'), 'mkdCode'
428 # Code Blocks in pre and code tag
435 Execute (code block in pre tag):
436 AssertEqual SyntaxOf('a'), 'mkdCode'
443 Execute (code block in code tag):
444 AssertEqual SyntaxOf('a'), 'mkdCode'
451 Execute (not code block in escaped pre tag):
452 AssertNotEqual SyntaxOf('a'), 'mkdCode'
459 Execute (not code block in escaped code tag):
460 AssertNotEqual SyntaxOf('a'), 'mkdCode'
471 AssertNotEqual SyntaxOf('x'), 'mkdMath'
472 AssertNotEqual SyntaxOf('y'), 'mkdMath'
473 let g:vim_markdown_math=1
475 AssertNotEqual SyntaxOf('a'), 'mkdMath'
476 AssertNotEqual SyntaxOf('b'), 'mkdMath'
477 AssertNotEqual SyntaxOf('c'), 'mkdMath'
478 AssertNotEqual SyntaxOf('d'), 'mkdMath'
479 AssertNotEqual SyntaxOf('e'), 'mkdMath'
480 AssertNotEqual SyntaxOf('f'), 'mkdMath'
481 AssertEqual SyntaxOf('x'), 'mkdMath'
482 AssertEqual SyntaxOf('y'), 'mkdMath'
483 let g:vim_markdown_math=0
485 AssertNotEqual SyntaxOf('x'), 'mkdMath'
486 AssertNotEqual SyntaxOf('y'), 'mkdMath'
497 Execute (multiline math):
498 let g:vim_markdown_math=1
500 AssertNotEqual SyntaxOf('a'), 'mkdMath'
501 AssertEqual SyntaxOf('b'), 'mkdMath'
502 AssertNotEqual SyntaxOf('c'), 'mkdMath'
508 Execute (math tex highlighting):
509 let g:vim_markdown_math=0
511 AssertNotEqual SyntaxOf('sqrt'), 'texStatement'
512 AssertNotEqual SyntaxOf('frac'), 'texStatement'
513 let g:vim_markdown_math=1
515 AssertEqual SyntaxOf('sqrt'), 'texStatement'
516 AssertEqual SyntaxOf('frac'), 'texStatement'
525 Execute (YAML frontmatter is controlled by the option):
526 AssertNotEqual SyntaxOf('a')[0:3], 'yaml'
527 let g:vim_markdown_frontmatter=1
529 AssertEqual SyntaxOf('a')[0:3], 'yaml'
530 let g:vim_markdown_frontmatter=0
532 AssertNotEqual SyntaxOf('a')[0:3], 'yaml'
540 Execute (YAML frontmatter only works if it's the first thing in the file):
541 let g:vim_markdown_frontmatter=1
543 AssertNotEqual SyntaxOf('a')[0:3], 'yaml'
552 Execute (rules are not mistaken by YAML frontmatter delimiters):
553 let g:vim_markdown_frontmatter=1
555 AssertEqual SyntaxAt(5, 1), 'mkdRule'
556 unlet g:vim_markdown_frontmatter
565 Execute (TOML frontmatter is controlled by the option):
567 AssertNotEqual SyntaxOf('b'), 'tomlString'
568 let g:vim_markdown_toml_frontmatter=1
570 AssertEqual SyntaxOf('b'), 'tomlString'
571 let g:vim_markdown_toml_frontmatter=0
573 AssertNotEqual SyntaxOf('b'), 'tomlString'
581 Execute (TOML frontmatter only works if it's the first thing in the file):
582 let g:vim_markdown_toml_frontmatter=1
584 AssertNotEqual SyntaxOf('b'), 'tomlString'
585 unlet g:vim_markdown_toml_frontmatter
594 Execute (JSON frontmatter is controlled by the option):
596 AssertNotEqual SyntaxOf('a'), 'jsonKeyword'
597 let g:vim_markdown_json_frontmatter=1
599 AssertEqual SyntaxOf('a'), 'jsonKeyword'
600 let g:vim_markdown_json_frontmatter=0
602 AssertNotEqual SyntaxOf('a'), 'jsonKeyword'
610 Execute (JSON frontmatter only works if it's the first thing in the file):
611 let g:vim_markdown_json_frontmatter=1
613 AssertNotEqual SyntaxOf('a'), 'jsonKeyword'
614 unlet g:vim_markdown_json_frontmatter
625 Execute (header title starts with #):
626 AssertEqual SyntaxOf('a'), 'htmlH1'
627 AssertEqual SyntaxOf('b'), 'htmlH2'
642 ## h2 trailing hash ##
648 ### h3 trailing hash ###
656 Execute (atx headers):
657 AssertEqual SyntaxOf('# h1 space'), 'htmlH1'
658 AssertEqual SyntaxOf('#h1 nospace'), 'htmlH1'
659 AssertEqual SyntaxOf('# h1 2 spaces'), 'htmlH1'
660 AssertEqual SyntaxOf('# h1 trailing hash #'), 'htmlH1'
661 AssertEqual SyntaxOf('## h2 space'), 'htmlH2'
662 AssertEqual SyntaxOf('##h2 nospace'), 'htmlH2'
663 AssertEqual SyntaxOf('## h2 trailing hash ##'), 'htmlH2'
664 AssertEqual SyntaxOf('### h3 space'), 'htmlH3'
665 AssertEqual SyntaxOf('###h3 nospace'), 'htmlH3'
666 AssertEqual SyntaxOf('### h3 trailing hash ###'), 'htmlH3'
667 AssertEqual SyntaxOf('#### h4'), 'htmlH4'
668 AssertEqual SyntaxOf('##### h5'), 'htmlH5'
669 AssertEqual SyntaxOf('###### h6'), 'htmlH6'
678 Execute (atx headers relative positions):
679 AssertEqual SyntaxOf('# h1 before h2'), 'htmlH1'
680 AssertEqual SyntaxOf('## h2 between h1s'), 'htmlH2'
681 AssertEqual SyntaxOf('# h1 after h2'), 'htmlH1'
690 setex h1 single punctuation
693 setex h1 punctuation longer than header
694 ================================
696 Execute (setex headers):
697 AssertEqual SyntaxOf('setex h1'), 'htmlH1'
698 AssertEqual SyntaxOf('^========$'), 'htmlH1'
699 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
700 AssertEqual SyntaxOf('--------'), 'htmlH2'
701 AssertEqual SyntaxOf('setex h1 single punctuation'), 'htmlH1'
702 AssertEqual SyntaxOf('^=$'), 'htmlH1'
703 AssertEqual SyntaxOf('setex h1 punctuation longer than header'), 'htmlH1'
704 AssertEqual SyntaxOf('^================================$'), 'htmlH1'
710 Execute (prevent list vs Setex confusion):
711 AssertNotEqual SyntaxOf('- not Setex'), 'htmlH2'
712 AssertNotEqual SyntaxOf('- becuase list'), 'htmlH2'
729 Execute (mixed atx and setex headers):
730 AssertEqual SyntaxOf('setex h1 before atx'), 'htmlH1'
731 AssertEqual SyntaxOf('==================='), 'htmlH1'
732 AssertEqual SyntaxOf('## atx h2'), 'htmlH2'
733 AssertEqual SyntaxOf('### atx h3'), 'htmlH3'
734 AssertEqual SyntaxOf('# atx h1'), 'htmlH1'
735 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
736 AssertEqual SyntaxOf('------------------'), 'htmlH2'
744 Execute (& and > are not marked as htmlError in lists):
745 AssertEqual SyntaxOf('-'), 'mkdListItem'
746 AssertEqual SyntaxOf('1.'), 'mkdListItem'
747 AssertNotEqual SyntaxOf('&'), 'htmlError'
748 AssertNotEqual SyntaxOf('>'), 'htmlError'
754 Execute (list after line break):
755 AssertEqual SyntaxOf('1'), 'mkdListItem'
756 AssertEqual SyntaxOf('2'), 'mkdListItem'
767 Execute (HTML tag in text):
768 AssertEqual SyntaxOf('p'), 'htmlTagName'
769 AssertEqual SyntaxOf('<p>'), 'htmlTag'
770 AssertEqual SyntaxOf('</p>'), 'htmlEndTag'
771 AssertEqual SyntaxOf('span'), 'htmlTagName'
772 AssertEqual SyntaxOf('<span>'), 'htmlTag'
773 AssertEqual SyntaxOf('</span>'), 'htmlEndTag'