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 scheme case is insensitive):
224 AssertEqual SyntaxOf('a'), 'mkdInlineURL'
229 Execute (autolink without scheme is not a link):
230 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
238 Execute (autolink with space is not a link):
239 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
240 AssertNotEqual SyntaxOf('b'), 'mkdInlineURL'
241 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
242 AssertNotEqual SyntaxOf('d'), 'mkdInlineURL'
243 AssertNotEqual SyntaxOf('e'), 'mkdInlineURL'
248 Execute (autolinks can be backslash escaped):
249 AssertNotEqual SyntaxOf('<'), 'mkdDelimiter'
254 Execute (autolink in parenthesis):
255 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
256 AssertEqual SyntaxOf('('), 'mkdDelimiter'
257 AssertEqual SyntaxOf('b'), 'mkdInlineURL'
258 AssertEqual SyntaxOf(')'), 'mkdDelimiter'
259 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
262 [![a](http://b)](http://c)
264 Execute (autolink in link text):
265 AssertEqual SyntaxOf('!'), 'mkdDelimiter'
266 AssertEqual SyntaxOf('a'), 'mkdLink'
267 AssertEqual SyntaxOf('b'), 'mkdURL'
268 AssertEqual SyntaxOf('c'), 'mkdURL'
277 Execute (code blocks can be fenced with tildes):
278 AssertEqual SyntaxOf('c'), 'mkdCode'
285 Execute (code blocks can be fenced with tildes longer than 3):
286 AssertEqual SyntaxOf('c'), 'mkdCode'
293 Execute (code blocks can be fenced with backticks longer than 3):
294 AssertEqual SyntaxOf('c'), 'mkdCode'
301 Execute (code blocks can have a language specifier):
302 AssertEqual SyntaxOf('c'), 'mkdCode'
311 Execute (code blocks can be fenced with backticks and a language specifier):
312 AssertEqual SyntaxOf('code'), 'mkdCode'
313 AssertNotEqual SyntaxOf('text'), 'mkdCode'
323 Execute (indent code blocks):
324 AssertNotEqual SyntaxOf('a'), 'mkdCode'
325 AssertEqual SyntaxOf('b'), 'mkdCode'
326 AssertEqual SyntaxOf('c'), 'mkdCode'
335 Execute (indent code blocks after header):
336 AssertNotEqual SyntaxOf('a'), 'mkdCode'
337 AssertNotEqual SyntaxOf('b'), 'mkdCode'
338 AssertEqual SyntaxOf('c'), 'mkdCode'
347 Execute (indent code blocks after list):
348 AssertNotEqual SyntaxOf('a'), 'mkdCode'
349 AssertNotEqual SyntaxOf('b'), 'mkdCode'
350 AssertEqual SyntaxOf('c'), 'mkdCode'
356 Execute (indent code block at beginning of file):
357 AssertEqual SyntaxOf('a'), 'mkdCode'
358 AssertEqual SyntaxOf('b'), 'mkdCode'
371 Execute (fenced code block syntax with a language specifier):
372 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
374 AssertEqual SyntaxOf('include'), 'cInclude'
375 AssertEqual SyntaxOf('code'), 'mkdSnippetCPP'
376 AssertEqual SyntaxOf('def'), 'rubyDefine'
387 Execute (fenced code block syntax with alias language specifier):
388 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
390 AssertEqual SyntaxOf('g:a'), 'vimVar'
391 AssertEqual SyntaxOf('g:b'), 'vimVar'
398 Execute (fenced code block syntax with an unknown language specifier):
399 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
401 AssertEqual SyntaxOf('code'), 'mkdSnippetA_B_'
410 Execute (first = or - in fenced code block is not setex headers):
411 AssertEqual SyntaxOf('='), 'mkdCode'
412 AssertEqual SyntaxOf('-'), 'mkdCode'
419 Execute (fenced code block with extended info strings):
420 AssertEqual SyntaxOf('a'), 'mkdCode'
422 # Code Blocks in pre and code tag
429 Execute (code block in pre tag):
430 AssertEqual SyntaxOf('a'), 'mkdCode'
437 Execute (code block in code tag):
438 AssertEqual SyntaxOf('a'), 'mkdCode'
445 Execute (not code block in escaped pre tag):
446 AssertNotEqual SyntaxOf('a'), 'mkdCode'
453 Execute (not code block in escaped code tag):
454 AssertNotEqual SyntaxOf('a'), 'mkdCode'
465 AssertNotEqual SyntaxOf('x'), 'mkdMath'
466 AssertNotEqual SyntaxOf('y'), 'mkdMath'
467 let g:vim_markdown_math=1
469 AssertNotEqual SyntaxOf('a'), 'mkdMath'
470 AssertNotEqual SyntaxOf('b'), 'mkdMath'
471 AssertNotEqual SyntaxOf('c'), 'mkdMath'
472 AssertNotEqual SyntaxOf('d'), 'mkdMath'
473 AssertNotEqual SyntaxOf('e'), 'mkdMath'
474 AssertNotEqual SyntaxOf('f'), 'mkdMath'
475 AssertEqual SyntaxOf('x'), 'mkdMath'
476 AssertEqual SyntaxOf('y'), 'mkdMath'
477 let g:vim_markdown_math=0
479 AssertNotEqual SyntaxOf('x'), 'mkdMath'
480 AssertNotEqual SyntaxOf('y'), 'mkdMath'
491 Execute (multiline math):
492 let g:vim_markdown_math=1
494 AssertNotEqual SyntaxOf('a'), 'mkdMath'
495 AssertEqual SyntaxOf('b'), 'mkdMath'
496 AssertNotEqual SyntaxOf('c'), 'mkdMath'
502 Execute (math tex highlighting):
503 let g:vim_markdown_math=0
505 AssertNotEqual SyntaxOf('sqrt'), 'texStatement'
506 AssertNotEqual SyntaxOf('frac'), 'texStatement'
507 let g:vim_markdown_math=1
509 AssertEqual SyntaxOf('sqrt'), 'texStatement'
510 AssertEqual SyntaxOf('frac'), 'texStatement'
519 Execute (YAML frontmatter is controlled by the option):
520 AssertNotEqual SyntaxOf('a')[0:3], 'yaml'
521 let g:vim_markdown_frontmatter=1
523 AssertEqual SyntaxOf('a')[0:3], 'yaml'
524 let g:vim_markdown_frontmatter=0
526 AssertNotEqual SyntaxOf('a')[0:3], 'yaml'
534 Execute (YAML frontmatter only works if it's the first thing in the file):
535 let g:vim_markdown_frontmatter=1
537 AssertNotEqual SyntaxOf('a')[0:3], 'yaml'
546 Execute (rules are not mistaken by YAML frontmatter delimiters):
547 let g:vim_markdown_frontmatter=1
549 AssertEqual SyntaxAt(5, 1), 'mkdRule'
550 unlet g:vim_markdown_frontmatter
559 Execute (TOML frontmatter is controlled by the option):
561 AssertNotEqual SyntaxOf('b'), 'tomlString'
562 let g:vim_markdown_toml_frontmatter=1
564 AssertEqual SyntaxOf('b'), 'tomlString'
565 let g:vim_markdown_toml_frontmatter=0
567 AssertNotEqual SyntaxOf('b'), 'tomlString'
575 Execute (TOML frontmatter only works if it's the first thing in the file):
576 let g:vim_markdown_toml_frontmatter=1
578 AssertNotEqual SyntaxOf('b'), 'tomlString'
579 unlet g:vim_markdown_toml_frontmatter
588 Execute (JSON frontmatter is controlled by the option):
590 AssertNotEqual SyntaxOf('a'), 'jsonKeyword'
591 let g:vim_markdown_json_frontmatter=1
593 AssertEqual SyntaxOf('a'), 'jsonKeyword'
594 let g:vim_markdown_json_frontmatter=0
596 AssertNotEqual SyntaxOf('a'), 'jsonKeyword'
604 Execute (JSON frontmatter only works if it's the first thing in the file):
605 let g:vim_markdown_json_frontmatter=1
607 AssertNotEqual SyntaxOf('a'), 'jsonKeyword'
608 unlet g:vim_markdown_json_frontmatter
619 Execute (header title starts with #):
620 AssertEqual SyntaxOf('a'), 'htmlH1'
621 AssertEqual SyntaxOf('b'), 'htmlH2'
636 ## h2 trailing hash ##
642 ### h3 trailing hash ###
650 Execute (atx headers):
651 AssertEqual SyntaxOf('# h1 space'), 'htmlH1'
652 AssertEqual SyntaxOf('#h1 nospace'), 'htmlH1'
653 AssertEqual SyntaxOf('# h1 2 spaces'), 'htmlH1'
654 AssertEqual SyntaxOf('# h1 trailing hash #'), 'htmlH1'
655 AssertEqual SyntaxOf('## h2 space'), 'htmlH2'
656 AssertEqual SyntaxOf('##h2 nospace'), 'htmlH2'
657 AssertEqual SyntaxOf('## h2 trailing hash ##'), 'htmlH2'
658 AssertEqual SyntaxOf('### h3 space'), 'htmlH3'
659 AssertEqual SyntaxOf('###h3 nospace'), 'htmlH3'
660 AssertEqual SyntaxOf('### h3 trailing hash ###'), 'htmlH3'
661 AssertEqual SyntaxOf('#### h4'), 'htmlH4'
662 AssertEqual SyntaxOf('##### h5'), 'htmlH5'
663 AssertEqual SyntaxOf('###### h6'), 'htmlH6'
672 Execute (atx headers relative positions):
673 AssertEqual SyntaxOf('# h1 before h2'), 'htmlH1'
674 AssertEqual SyntaxOf('## h2 between h1s'), 'htmlH2'
675 AssertEqual SyntaxOf('# h1 after h2'), 'htmlH1'
684 setex h1 single punctuation
687 setex h1 punctuation longer than header
688 ================================
690 Execute (setex headers):
691 AssertEqual SyntaxOf('setex h1'), 'htmlH1'
692 AssertEqual SyntaxOf('^========$'), 'htmlH1'
693 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
694 AssertEqual SyntaxOf('--------'), 'htmlH2'
695 AssertEqual SyntaxOf('setex h1 single punctuation'), 'htmlH1'
696 AssertEqual SyntaxOf('^=$'), 'htmlH1'
697 AssertEqual SyntaxOf('setex h1 punctuation longer than header'), 'htmlH1'
698 AssertEqual SyntaxOf('^================================$'), 'htmlH1'
704 Execute (prevent list vs Setex confusion):
705 AssertNotEqual SyntaxOf('- not Setex'), 'htmlH2'
706 AssertNotEqual SyntaxOf('- becuase list'), 'htmlH2'
723 Execute (mixed atx and setex headers):
724 AssertEqual SyntaxOf('setex h1 before atx'), 'htmlH1'
725 AssertEqual SyntaxOf('==================='), 'htmlH1'
726 AssertEqual SyntaxOf('## atx h2'), 'htmlH2'
727 AssertEqual SyntaxOf('### atx h3'), 'htmlH3'
728 AssertEqual SyntaxOf('# atx h1'), 'htmlH1'
729 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
730 AssertEqual SyntaxOf('------------------'), 'htmlH2'
738 Execute (& and > are not marked as htmlError in lists):
739 AssertEqual SyntaxOf('-'), 'mkdListItem'
740 AssertEqual SyntaxOf('1.'), 'mkdListItem'
741 AssertNotEqual SyntaxOf('&'), 'htmlError'
742 AssertNotEqual SyntaxOf('>'), 'htmlError'
748 Execute (list after line break):
749 AssertEqual SyntaxOf('1'), 'mkdListItem'
750 AssertEqual SyntaxOf('2'), 'mkdListItem'
761 Execute (HTML tag in text):
762 AssertEqual SyntaxOf('p'), 'htmlTagName'
763 AssertEqual SyntaxOf('<p>'), 'htmlTag'
764 AssertEqual SyntaxOf('</p>'), 'htmlEndTag'
765 AssertEqual SyntaxOf('span'), 'htmlTagName'
766 AssertEqual SyntaxOf('<span>'), 'htmlTag'
767 AssertEqual SyntaxOf('</span>'), 'htmlEndTag'