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
208 Execute (disable conceal):
210 let g:vim_markdown_conceal=0
212 setlocal conceallevel=2
213 AssertEqual synconcealed(1, 1)[0], 0
214 AssertEqual synconcealed(1, 2)[0], 0
215 AssertEqual synconcealed(1, 3)[0], 0
216 AssertEqual synconcealed(1, 4)[0], 0
217 AssertEqual synconcealed(1, 4)[0], 0
218 AssertEqual synconcealed(1, 5)[0], 0
219 AssertEqual synconcealed(1, 6)[0], 0
221 let g:vim_markdown_conceal=1
223 AssertEqual synconcealed(1, 1)[0], 1
224 AssertEqual synconcealed(1, 2)[0], 0
225 AssertEqual synconcealed(1, 3)[0], 1
226 AssertEqual synconcealed(1, 4)[0], 1
227 AssertEqual synconcealed(1, 4)[0], 1
228 AssertEqual synconcealed(1, 5)[0], 1
229 AssertEqual synconcealed(1, 6)[0], 1
231 setlocal conceallevel=0
232 unlet g:vim_markdown_conceal
242 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
243 AssertEqual SyntaxOf('<'), 'mkdDelimiter'
244 AssertEqual SyntaxOf('b'), 'mkdInlineURL'
245 AssertEqual SyntaxOf('>'), 'mkdDelimiter'
246 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
251 Execute (autolink with domain starting with a number):
252 AssertEqual SyntaxOf('12monkeys'), 'mkdInlineURL'
257 Execute (autolink with scheme case is insensitive):
258 AssertEqual SyntaxOf('a'), 'mkdInlineURL'
263 Execute (autolink without scheme is not a link):
264 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
272 Execute (autolink with space is not a link):
273 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
274 AssertNotEqual SyntaxOf('b'), 'mkdInlineURL'
275 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
276 AssertNotEqual SyntaxOf('d'), 'mkdInlineURL'
277 AssertNotEqual SyntaxOf('e'), 'mkdInlineURL'
282 Execute (autolinks can be backslash escaped):
283 AssertNotEqual SyntaxOf('<'), 'mkdDelimiter'
288 Execute (autolink in parenthesis):
289 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
290 AssertEqual SyntaxOf('('), 'mkdDelimiter'
291 AssertEqual SyntaxOf('b'), 'mkdInlineURL'
292 AssertEqual SyntaxOf(')'), 'mkdDelimiter'
293 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
296 [![a](http://b)](http://c)
298 Execute (autolink in link text):
299 AssertEqual SyntaxOf('!'), 'mkdDelimiter'
300 AssertEqual SyntaxOf('a'), 'mkdLink'
301 AssertEqual SyntaxOf('b'), 'mkdURL'
302 AssertEqual SyntaxOf('c'), 'mkdURL'
311 Execute (code blocks can be fenced with tildes):
312 AssertEqual SyntaxOf('c'), 'mkdCode'
319 Execute (code blocks can be fenced with tildes longer than 3):
320 AssertEqual SyntaxOf('c'), 'mkdCode'
327 Execute (code blocks can be fenced with backticks longer than 3):
328 AssertEqual SyntaxOf('c'), 'mkdCode'
335 Execute (code blocks can have a language specifier):
336 AssertEqual SyntaxOf('c'), 'mkdCode'
345 Execute (code blocks can be fenced with backticks and a language specifier):
346 AssertEqual SyntaxOf('code'), 'mkdCode'
347 AssertNotEqual SyntaxOf('text'), 'mkdCode'
357 Execute (indent code blocks):
358 AssertNotEqual SyntaxOf('a'), 'mkdCode'
359 AssertEqual SyntaxOf('b'), 'mkdCode'
360 AssertEqual SyntaxOf('c'), 'mkdCode'
369 Execute (indent code blocks after header):
370 AssertNotEqual SyntaxOf('a'), 'mkdCode'
371 AssertNotEqual SyntaxOf('b'), 'mkdCode'
372 AssertEqual SyntaxOf('c'), 'mkdCode'
381 Execute (indent code blocks after list):
382 AssertNotEqual SyntaxOf('a'), 'mkdCode'
383 AssertNotEqual SyntaxOf('b'), 'mkdCode'
384 AssertEqual SyntaxOf('c'), 'mkdCode'
390 Execute (indent code block at beginning of file):
391 AssertEqual SyntaxOf('a'), 'mkdCode'
392 AssertEqual SyntaxOf('b'), 'mkdCode'
405 Execute (fenced code block syntax with a language specifier):
406 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
408 AssertEqual SyntaxOf('include'), 'cInclude'
409 AssertEqual SyntaxOf('code'), 'mkdSnippetCPP'
410 AssertEqual SyntaxOf('def'), 'rubyDefine'
421 Execute (fenced code block syntax with alias language specifier):
422 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
424 AssertEqual SyntaxOf('g:a'), 'vimVar'
425 AssertEqual SyntaxOf('g:b'), 'vimVar'
432 Execute (fenced code block languages setting):
433 let g:vim_markdown_fenced_languages = ['csharp=cs']
434 source ../ftplugin/markdown.vim
435 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
437 AssertEqual SyntaxOf('foo'), 'csString'
438 unlet g:vim_markdown_fenced_languages
445 Execute (fenced code block syntax with an unknown language specifier):
446 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
448 AssertEqual SyntaxOf('code'), 'mkdSnippetA_B_'
457 Execute (first = or - in fenced code block is not setex headers):
458 AssertEqual SyntaxOf('='), 'mkdCode'
459 AssertEqual SyntaxOf('-'), 'mkdCode'
466 Execute (fenced code block with extended info strings):
467 AssertEqual SyntaxOf('a'), 'mkdCode'
469 # Code Blocks in pre and code tag
476 Execute (code block in pre tag):
477 AssertEqual SyntaxOf('a'), 'mkdCode'
484 Execute (code block in code tag):
485 AssertEqual SyntaxOf('a'), 'mkdCode'
492 Execute (not code block in escaped pre tag):
493 AssertNotEqual SyntaxOf('a'), 'mkdCode'
500 Execute (not code block in escaped code tag):
501 AssertNotEqual SyntaxOf('a'), 'mkdCode'
512 AssertNotEqual SyntaxOf('x'), 'mkdMath'
513 AssertNotEqual SyntaxOf('y'), 'mkdMath'
514 let g:vim_markdown_math=1
516 AssertNotEqual SyntaxOf('a'), 'mkdMath'
517 AssertNotEqual SyntaxOf('b'), 'mkdMath'
518 AssertNotEqual SyntaxOf('c'), 'mkdMath'
519 AssertNotEqual SyntaxOf('d'), 'mkdMath'
520 AssertNotEqual SyntaxOf('e'), 'mkdMath'
521 AssertNotEqual SyntaxOf('f'), 'mkdMath'
522 AssertEqual SyntaxOf('x'), 'mkdMath'
523 AssertEqual SyntaxOf('y'), 'mkdMath'
524 let g:vim_markdown_math=0
526 AssertNotEqual SyntaxOf('x'), 'mkdMath'
527 AssertNotEqual SyntaxOf('y'), 'mkdMath'
538 Execute (multiline math):
539 let g:vim_markdown_math=1
541 AssertNotEqual SyntaxOf('a'), 'mkdMath'
542 AssertEqual SyntaxOf('b'), 'mkdMath'
543 AssertNotEqual SyntaxOf('c'), 'mkdMath'
549 Execute (math tex highlighting):
550 let g:vim_markdown_math=0
552 AssertNotEqual SyntaxOf('sqrt'), 'texStatement'
553 AssertNotEqual SyntaxOf('frac'), 'texStatement'
554 let g:vim_markdown_math=1
556 AssertEqual SyntaxOf('sqrt'), 'texStatement'
557 AssertEqual SyntaxOf('frac'), 'texStatement'
566 Execute (YAML frontmatter is controlled by the option):
567 AssertNotEqual SyntaxOf('a')[0:3], 'yaml'
568 let g:vim_markdown_frontmatter=1
570 AssertEqual SyntaxOf('a')[0:3], 'yaml'
571 let g:vim_markdown_frontmatter=0
573 AssertNotEqual SyntaxOf('a')[0:3], 'yaml'
581 Execute (YAML frontmatter only works if it's the first thing in the file):
582 let g:vim_markdown_frontmatter=1
584 AssertNotEqual SyntaxOf('a')[0:3], 'yaml'
593 Execute (rules are not mistaken by YAML frontmatter delimiters):
594 let g:vim_markdown_frontmatter=1
596 AssertEqual SyntaxAt(5, 1), 'mkdRule'
597 unlet g:vim_markdown_frontmatter
606 Execute (TOML frontmatter is controlled by the option):
608 AssertNotEqual SyntaxOf('b'), 'tomlString'
609 let g:vim_markdown_toml_frontmatter=1
611 AssertEqual SyntaxOf('b'), 'tomlString'
612 let g:vim_markdown_toml_frontmatter=0
614 AssertNotEqual SyntaxOf('b'), 'tomlString'
622 Execute (TOML frontmatter only works if it's the first thing in the file):
623 let g:vim_markdown_toml_frontmatter=1
625 AssertNotEqual SyntaxOf('b'), 'tomlString'
626 unlet g:vim_markdown_toml_frontmatter
635 Execute (JSON frontmatter is controlled by the option):
637 AssertNotEqual SyntaxOf('a'), 'jsonKeyword'
638 let g:vim_markdown_json_frontmatter=1
640 AssertEqual SyntaxOf('a'), 'jsonKeyword'
641 let g:vim_markdown_json_frontmatter=0
643 AssertNotEqual SyntaxOf('a'), 'jsonKeyword'
651 Execute (JSON frontmatter only works if it's the first thing in the file):
652 let g:vim_markdown_json_frontmatter=1
654 AssertNotEqual SyntaxOf('a'), 'jsonKeyword'
655 unlet g:vim_markdown_json_frontmatter
666 Execute (header title starts with #):
667 AssertEqual SyntaxOf('a'), 'htmlH1'
668 AssertEqual SyntaxOf('b'), 'htmlH2'
683 ## h2 trailing hash ##
689 ### h3 trailing hash ###
697 Execute (atx headers):
698 AssertEqual SyntaxOf('# h1 space'), 'htmlH1'
699 AssertEqual SyntaxOf('#h1 nospace'), 'htmlH1'
700 AssertEqual SyntaxOf('# h1 2 spaces'), 'htmlH1'
701 AssertEqual SyntaxOf('# h1 trailing hash #'), 'htmlH1'
702 AssertEqual SyntaxOf('## h2 space'), 'htmlH2'
703 AssertEqual SyntaxOf('##h2 nospace'), 'htmlH2'
704 AssertEqual SyntaxOf('## h2 trailing hash ##'), 'htmlH2'
705 AssertEqual SyntaxOf('### h3 space'), 'htmlH3'
706 AssertEqual SyntaxOf('###h3 nospace'), 'htmlH3'
707 AssertEqual SyntaxOf('### h3 trailing hash ###'), 'htmlH3'
708 AssertEqual SyntaxOf('#### h4'), 'htmlH4'
709 AssertEqual SyntaxOf('##### h5'), 'htmlH5'
710 AssertEqual SyntaxOf('###### h6'), 'htmlH6'
719 Execute (atx headers relative positions):
720 AssertEqual SyntaxOf('# h1 before h2'), 'htmlH1'
721 AssertEqual SyntaxOf('## h2 between h1s'), 'htmlH2'
722 AssertEqual SyntaxOf('# h1 after h2'), 'htmlH1'
731 setex h1 single punctuation
734 setex h1 punctuation longer than header
735 ================================
737 Execute (setex headers):
738 AssertEqual SyntaxOf('setex h1'), 'htmlH1'
739 AssertEqual SyntaxOf('^========$'), 'htmlH1'
740 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
741 AssertEqual SyntaxOf('--------'), 'htmlH2'
742 AssertEqual SyntaxOf('setex h1 single punctuation'), 'htmlH1'
743 AssertEqual SyntaxOf('^=$'), 'htmlH1'
744 AssertEqual SyntaxOf('setex h1 punctuation longer than header'), 'htmlH1'
745 AssertEqual SyntaxOf('^================================$'), 'htmlH1'
751 Execute (prevent list vs Setex confusion):
752 AssertNotEqual SyntaxOf('- not Setex'), 'htmlH2'
753 AssertNotEqual SyntaxOf('- becuase list'), 'htmlH2'
770 Execute (mixed atx and setex headers):
771 AssertEqual SyntaxOf('setex h1 before atx'), 'htmlH1'
772 AssertEqual SyntaxOf('==================='), 'htmlH1'
773 AssertEqual SyntaxOf('## atx h2'), 'htmlH2'
774 AssertEqual SyntaxOf('### atx h3'), 'htmlH3'
775 AssertEqual SyntaxOf('# atx h1'), 'htmlH1'
776 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
777 AssertEqual SyntaxOf('------------------'), 'htmlH2'
785 Execute (& and > are not marked as htmlError in lists):
786 AssertEqual SyntaxOf('-'), 'mkdListItem'
787 AssertEqual SyntaxOf('1.'), 'mkdListItem'
788 AssertNotEqual SyntaxOf('&'), 'htmlError'
789 AssertNotEqual SyntaxOf('>'), 'htmlError'
795 Execute (list after line break):
796 AssertEqual SyntaxOf('1'), 'mkdListItem'
797 AssertEqual SyntaxOf('2'), 'mkdListItem'
808 Execute (HTML tag in text):
809 AssertEqual SyntaxOf('p'), 'htmlTagName'
810 AssertEqual SyntaxOf('<p>'), 'htmlTag'
811 AssertEqual SyntaxOf('</p>'), 'htmlEndTag'
812 AssertEqual SyntaxOf('span'), 'htmlTagName'
813 AssertEqual SyntaxOf('<span>'), 'htmlTag'
814 AssertEqual SyntaxOf('</span>'), 'htmlEndTag'