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):
196 setlocal conceallevel=2
197 AssertEqual synconcealed(1, 1)[0], 1
198 AssertEqual synconcealed(1, 2)[0], 0
199 AssertEqual synconcealed(1, 3)[0], 1
200 AssertEqual synconcealed(1, 4)[0], 1
201 AssertEqual synconcealed(1, 4)[0], 1
202 AssertEqual synconcealed(1, 5)[0], 1
203 AssertEqual synconcealed(1, 6)[0], 1
204 setlocal conceallevel=0
212 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
213 AssertEqual SyntaxOf('<'), 'mkdDelimiter'
214 AssertEqual SyntaxOf('b'), 'mkdInlineURL'
215 AssertEqual SyntaxOf('>'), 'mkdDelimiter'
216 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
221 Execute (autolink with scheme case is insensitive):
222 AssertEqual SyntaxOf('a'), 'mkdInlineURL'
227 Execute (autolink without scheme is not a link):
228 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
236 Execute (autolink with space is not a link):
237 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
238 AssertNotEqual SyntaxOf('b'), 'mkdInlineURL'
239 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
240 AssertNotEqual SyntaxOf('d'), 'mkdInlineURL'
241 AssertNotEqual SyntaxOf('e'), 'mkdInlineURL'
246 Execute (autolinks can be backslash escaped):
247 AssertNotEqual SyntaxOf('<'), 'mkdDelimiter'
252 Execute (autolink in parenthesis):
253 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
254 AssertEqual SyntaxOf('('), 'mkdDelimiter'
255 AssertEqual SyntaxOf('b'), 'mkdInlineURL'
256 AssertEqual SyntaxOf(')'), 'mkdDelimiter'
257 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
260 [![a](http://b)](http://c)
262 Execute (autolink in link text):
263 AssertEqual SyntaxOf('!'), 'mkdDelimiter'
264 AssertEqual SyntaxOf('a'), 'mkdLink'
265 AssertEqual SyntaxOf('b'), 'mkdURL'
266 AssertEqual SyntaxOf('c'), 'mkdURL'
275 Execute (code blocks can be fenced with tildes):
276 AssertEqual SyntaxOf('c'), 'mkdCode'
283 Execute (code blocks can be fenced with tildes longer than 3):
284 AssertEqual SyntaxOf('c'), 'mkdCode'
291 Execute (code blocks can be fenced with backticks longer than 3):
292 AssertEqual SyntaxOf('c'), 'mkdCode'
299 Execute (code blocks can have a language specifier):
300 AssertEqual SyntaxOf('c'), 'mkdCode'
309 Execute (code blocks can be fenced with backticks and a language specifier):
310 AssertEqual SyntaxOf('code'), 'mkdCode'
311 AssertNotEqual SyntaxOf('text'), 'mkdCode'
321 Execute (indent code blocks):
322 AssertNotEqual SyntaxOf('a'), 'mkdCode'
323 AssertEqual SyntaxOf('b'), 'mkdCode'
324 AssertEqual SyntaxOf('c'), 'mkdCode'
333 Execute (indent code blocks after header):
334 AssertNotEqual SyntaxOf('a'), 'mkdCode'
335 AssertNotEqual SyntaxOf('b'), 'mkdCode'
336 AssertEqual SyntaxOf('c'), 'mkdCode'
345 Execute (indent code blocks after list):
346 AssertNotEqual SyntaxOf('a'), 'mkdCode'
347 AssertNotEqual SyntaxOf('b'), 'mkdCode'
348 AssertEqual SyntaxOf('c'), 'mkdCode'
354 Execute (indent code block at beginning of file):
355 AssertEqual SyntaxOf('a'), 'mkdCode'
356 AssertEqual SyntaxOf('b'), 'mkdCode'
369 Execute (fenced code block syntax with a language specifier):
370 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
372 AssertEqual SyntaxOf('include'), 'cInclude'
373 AssertEqual SyntaxOf('code'), 'mkdSnippetCPP'
374 AssertEqual SyntaxOf('def'), 'rubyDefine'
381 Execute (fenced code block syntax with an unknown language specifier):
382 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
384 AssertEqual SyntaxOf('code'), 'mkdSnippetA_B_'
394 Execute (first = or - in fenced code block is not setex headers):
395 AssertEqual SyntaxOf('='), 'mkdCode'
396 AssertEqual SyntaxOf('-'), 'mkdCode'
403 Execute (fenced code block with extended info strings):
404 AssertEqual SyntaxOf('a'), 'mkdCode'
406 # Code Blocks in pre and code tag
413 Execute (code block in pre tag):
414 AssertEqual SyntaxOf('a'), 'mkdCode'
421 Execute (code block in code tag):
422 AssertEqual SyntaxOf('a'), 'mkdCode'
429 Execute (not code block in escaped pre tag):
430 AssertNotEqual SyntaxOf('a'), 'mkdCode'
437 Execute (not code block in escaped code tag):
438 AssertNotEqual SyntaxOf('a'), 'mkdCode'
449 AssertNotEqual SyntaxOf('x'), 'mkdMath'
450 AssertNotEqual SyntaxOf('y'), 'mkdMath'
451 let g:vim_markdown_math=1
453 AssertNotEqual SyntaxOf('a'), 'mkdMath'
454 AssertNotEqual SyntaxOf('b'), 'mkdMath'
455 AssertNotEqual SyntaxOf('c'), 'mkdMath'
456 AssertNotEqual SyntaxOf('d'), 'mkdMath'
457 AssertNotEqual SyntaxOf('e'), 'mkdMath'
458 AssertNotEqual SyntaxOf('f'), 'mkdMath'
459 AssertEqual SyntaxOf('x'), 'mkdMath'
460 AssertEqual SyntaxOf('y'), 'mkdMath'
461 let g:vim_markdown_math=0
463 AssertNotEqual SyntaxOf('x'), 'mkdMath'
464 AssertNotEqual SyntaxOf('y'), 'mkdMath'
475 Execute (multiline math):
476 let g:vim_markdown_math=1
478 AssertNotEqual SyntaxOf('a'), 'mkdMath'
479 AssertEqual SyntaxOf('b'), 'mkdMath'
480 AssertNotEqual SyntaxOf('c'), 'mkdMath'
486 Execute (math tex highlighting):
487 let g:vim_markdown_math=0
489 AssertNotEqual SyntaxOf('sqrt'), 'texStatement'
490 AssertNotEqual SyntaxOf('frac'), 'texStatement'
491 let g:vim_markdown_math=1
493 AssertEqual SyntaxOf('sqrt'), 'texStatement'
494 AssertEqual SyntaxOf('frac'), 'texStatement'
503 Execute (YAML frontmatter is controlled by the option):
504 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
505 let g:vim_markdown_frontmatter=1
507 AssertEqual SyntaxOf('a'), 'yamlBlockMappingKey'
508 let g:vim_markdown_frontmatter=0
510 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
518 Execute (YAML frontmatter only works if it's the first thing in the file):
519 let g:vim_markdown_frontmatter=1
521 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
530 Execute (rules are not mistaken by YAML frontmatter delimiters):
531 let g:vim_markdown_frontmatter=1
533 AssertEqual SyntaxAt(5, 1), 'mkdRule'
534 unlet g:vim_markdown_frontmatter
543 Execute (TOML frontmatter is controlled by the option):
545 AssertNotEqual SyntaxOf('b'), 'tomlString'
546 let g:vim_markdown_toml_frontmatter=1
548 AssertEqual SyntaxOf('b'), 'tomlString'
549 let g:vim_markdown_toml_frontmatter=0
551 AssertNotEqual SyntaxOf('b'), 'tomlString'
559 Execute (TOML frontmatter only works if it's the first thing in the file):
560 let g:vim_markdown_toml_frontmatter=1
562 AssertNotEqual SyntaxOf('b'), 'tomlString'
563 unlet g:vim_markdown_toml_frontmatter
572 Execute (JSON frontmatter is controlled by the option):
574 AssertNotEqual SyntaxOf('a'), 'jsonKeyword'
575 let g:vim_markdown_json_frontmatter=1
577 AssertEqual SyntaxOf('a'), 'jsonKeyword'
578 let g:vim_markdown_json_frontmatter=0
580 AssertNotEqual SyntaxOf('a'), 'jsonKeyword'
588 Execute (JSON frontmatter only works if it's the first thing in the file):
589 let g:vim_markdown_json_frontmatter=1
591 AssertNotEqual SyntaxOf('a'), 'jsonKeyword'
592 unlet g:vim_markdown_json_frontmatter
603 Execute (header title starts with #):
604 AssertEqual SyntaxOf('a'), 'htmlH1'
605 AssertEqual SyntaxOf('b'), 'htmlH2'
620 ## h2 trailing hash ##
626 ### h3 trailing hash ###
634 Execute (atx headers):
635 AssertEqual SyntaxOf('# h1 space'), 'htmlH1'
636 AssertEqual SyntaxOf('#h1 nospace'), 'htmlH1'
637 AssertEqual SyntaxOf('# h1 2 spaces'), 'htmlH1'
638 AssertEqual SyntaxOf('# h1 trailing hash #'), 'htmlH1'
639 AssertEqual SyntaxOf('## h2 space'), 'htmlH2'
640 AssertEqual SyntaxOf('##h2 nospace'), 'htmlH2'
641 AssertEqual SyntaxOf('## h2 trailing hash ##'), 'htmlH2'
642 AssertEqual SyntaxOf('### h3 space'), 'htmlH3'
643 AssertEqual SyntaxOf('###h3 nospace'), 'htmlH3'
644 AssertEqual SyntaxOf('### h3 trailing hash ###'), 'htmlH3'
645 AssertEqual SyntaxOf('#### h4'), 'htmlH4'
646 AssertEqual SyntaxOf('##### h5'), 'htmlH5'
647 AssertEqual SyntaxOf('###### h6'), 'htmlH6'
656 Execute (atx headers relative positions):
657 AssertEqual SyntaxOf('# h1 before h2'), 'htmlH1'
658 AssertEqual SyntaxOf('## h2 between h1s'), 'htmlH2'
659 AssertEqual SyntaxOf('# h1 after h2'), 'htmlH1'
668 setex h1 single punctuation
671 setex h1 punctuation longer than header
672 ================================
674 Execute (setex headers):
675 AssertEqual SyntaxOf('setex h1'), 'htmlH1'
676 AssertEqual SyntaxOf('^========$'), 'htmlH1'
677 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
678 AssertEqual SyntaxOf('--------'), 'htmlH2'
679 AssertEqual SyntaxOf('setex h1 single punctuation'), 'htmlH1'
680 AssertEqual SyntaxOf('^=$'), 'htmlH1'
681 AssertEqual SyntaxOf('setex h1 punctuation longer than header'), 'htmlH1'
682 AssertEqual SyntaxOf('^================================$'), 'htmlH1'
688 Execute (prevent list vs Setex confusion):
689 AssertNotEqual SyntaxOf('- not Setex'), 'htmlH2'
690 AssertNotEqual SyntaxOf('- becuase list'), 'htmlH2'
707 Execute (mixed atx and setex headers):
708 AssertEqual SyntaxOf('setex h1 before atx'), 'htmlH1'
709 AssertEqual SyntaxOf('==================='), 'htmlH1'
710 AssertEqual SyntaxOf('## atx h2'), 'htmlH2'
711 AssertEqual SyntaxOf('### atx h3'), 'htmlH3'
712 AssertEqual SyntaxOf('# atx h1'), 'htmlH1'
713 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
714 AssertEqual SyntaxOf('------------------'), 'htmlH2'
722 Execute (& and > are not marked as htmlError in lists):
723 AssertEqual SyntaxOf('-'), 'mkdListItem'
724 AssertEqual SyntaxOf('1.'), 'mkdListItem'
725 AssertNotEqual SyntaxOf('&'), 'htmlError'
726 AssertNotEqual SyntaxOf('>'), 'htmlError'
732 Execute (list after line break):
733 AssertEqual SyntaxOf('1'), 'mkdListItem'
734 AssertEqual SyntaxOf('2'), 'mkdListItem'
745 Execute (HTML tag in text):
746 AssertEqual SyntaxOf('p'), 'htmlTagName'
747 AssertEqual SyntaxOf('<p>'), 'htmlTag'
748 AssertEqual SyntaxOf('</p>'), 'htmlEndTag'
749 AssertEqual SyntaxOf('span'), 'htmlTagName'
750 AssertEqual SyntaxOf('<span>'), 'htmlTag'
751 AssertEqual SyntaxOf('</span>'), 'htmlEndTag'