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'
165 Execute (parenthesis not in link):
166 AssertNotEqual SyntaxOf('a'), 'mkdURL'
167 AssertNotEqual SyntaxOf('b'), 'mkdURL'
172 Execute (multiple links on a line):
173 AssertNotEqual SyntaxOf('c'), 'mkdLink'
174 AssertNotEqual SyntaxOf('c'), 'mkdURL'
179 Execute (space is not allowed between link text and parenthesis):
180 AssertNotEqual SyntaxOf('a'), 'mkdLink'
181 AssertNotEqual SyntaxOf('b'), 'mkdURL'
186 Execute (conceal link):
187 setlocal conceallevel=2
188 AssertEqual synconcealed(1, 1)[0], 1
189 AssertEqual synconcealed(1, 2)[0], 0
190 AssertEqual synconcealed(1, 3)[0], 1
191 AssertEqual synconcealed(1, 4)[0], 1
192 AssertEqual synconcealed(1, 4)[0], 1
193 AssertEqual synconcealed(1, 5)[0], 1
194 AssertEqual synconcealed(1, 6)[0], 1
195 setlocal conceallevel=0
203 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
204 AssertEqual SyntaxOf('<'), 'mkdDelimiter'
205 AssertEqual SyntaxOf('b'), 'mkdInlineURL'
206 AssertEqual SyntaxOf('>'), 'mkdDelimiter'
207 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
212 Execute (autolink with scheme case is insensitive):
213 AssertEqual SyntaxOf('a'), 'mkdInlineURL'
218 Execute (autolink without scheme is not a link):
219 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
227 Execute (autolink with space is not a link):
228 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
229 AssertNotEqual SyntaxOf('b'), 'mkdInlineURL'
230 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
231 AssertNotEqual SyntaxOf('d'), 'mkdInlineURL'
232 AssertNotEqual SyntaxOf('e'), 'mkdInlineURL'
237 Execute (autolinks can be backslash escaped):
238 AssertNotEqual SyntaxOf('<'), 'mkdDelimiter'
243 Execute (autolink in parenthesis):
244 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
245 AssertEqual SyntaxOf('('), 'mkdDelimiter'
246 AssertEqual SyntaxOf('b'), 'mkdInlineURL'
247 AssertEqual SyntaxOf(')'), 'mkdDelimiter'
248 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
251 [![a](http://b)](http://c)
253 Execute (autolink in link text):
254 AssertEqual SyntaxOf('!'), 'mkdDelimiter'
255 AssertEqual SyntaxOf('a'), 'mkdLink'
256 AssertEqual SyntaxOf('b'), 'mkdURL'
257 AssertEqual SyntaxOf('c'), 'mkdURL'
266 Execute (code blocks can be fenced with tildes):
267 AssertEqual SyntaxOf('c'), 'mkdCode'
274 Execute (code blocks can be fenced with tildes longer than 3):
275 AssertEqual SyntaxOf('c'), 'mkdCode'
282 Execute (code blocks can be fenced with backticks longer than 3):
283 AssertEqual SyntaxOf('c'), 'mkdCode'
290 Execute (code blocks can have a language specifier):
291 AssertEqual SyntaxOf('c'), 'mkdCode'
300 Execute (code blocks can be fenced with backticks and a language specifier):
301 AssertEqual SyntaxOf('code'), 'mkdCode'
302 AssertNotEqual SyntaxOf('text'), 'mkdCode'
312 Execute (indent code blocks):
313 AssertNotEqual SyntaxOf('a'), 'mkdCode'
314 AssertEqual SyntaxOf('b'), 'mkdCode'
315 AssertEqual SyntaxOf('c'), 'mkdCode'
324 Execute (indent code blocks after header):
325 AssertNotEqual SyntaxOf('a'), 'mkdCode'
326 AssertNotEqual SyntaxOf('b'), 'mkdCode'
327 AssertEqual SyntaxOf('c'), 'mkdCode'
336 Execute (indent code blocks after list):
337 AssertNotEqual SyntaxOf('a'), 'mkdCode'
338 AssertNotEqual SyntaxOf('b'), 'mkdCode'
339 AssertEqual SyntaxOf('c'), 'mkdCode'
345 Execute (indent code block at beginning of file):
346 AssertEqual SyntaxOf('a'), 'mkdCode'
347 AssertEqual SyntaxOf('b'), 'mkdCode'
360 Execute (fenced code block syntax with a language specifier):
361 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
363 AssertEqual SyntaxOf('include'), 'cInclude'
364 AssertEqual SyntaxOf('code'), 'mkdSnippetCPP'
365 AssertEqual SyntaxOf('def'), 'rubyDefine'
372 Execute (fenced code block syntax with an unknown language specifier):
373 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
375 AssertEqual SyntaxOf('code'), 'mkdSnippetA_B_'
385 Execute (first = or - in fenced code block is not setex headers):
386 AssertEqual SyntaxOf('='), 'mkdCode'
387 AssertEqual SyntaxOf('-'), 'mkdCode'
398 AssertNotEqual SyntaxOf('x'), 'mkdMath'
399 AssertNotEqual SyntaxOf('y'), 'mkdMath'
400 let g:vim_markdown_math=1
402 AssertNotEqual SyntaxOf('a'), 'mkdMath'
403 AssertNotEqual SyntaxOf('b'), 'mkdMath'
404 AssertNotEqual SyntaxOf('c'), 'mkdMath'
405 AssertNotEqual SyntaxOf('d'), 'mkdMath'
406 AssertNotEqual SyntaxOf('e'), 'mkdMath'
407 AssertNotEqual SyntaxOf('f'), 'mkdMath'
408 AssertEqual SyntaxOf('x'), 'mkdMath'
409 AssertEqual SyntaxOf('y'), 'mkdMath'
410 let g:vim_markdown_math=0
412 AssertNotEqual SyntaxOf('x'), 'mkdMath'
413 AssertNotEqual SyntaxOf('y'), 'mkdMath'
424 Execute (multiline math):
425 let g:vim_markdown_math=1
427 AssertNotEqual SyntaxOf('a'), 'mkdMath'
428 AssertEqual SyntaxOf('b'), 'mkdMath'
429 AssertNotEqual SyntaxOf('c'), 'mkdMath'
435 Execute (math tex highlighting):
436 let g:vim_markdown_math=0
438 AssertNotEqual SyntaxOf('sqrt'), 'texStatement'
439 AssertNotEqual SyntaxOf('frac'), 'texStatement'
440 let g:vim_markdown_math=1
442 AssertEqual SyntaxOf('sqrt'), 'texStatement'
443 AssertEqual SyntaxOf('frac'), 'texStatement'
452 Execute (YAML frontmatter is controlled by the option):
453 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
454 let g:vim_markdown_frontmatter=1
456 AssertEqual SyntaxOf('a'), 'yamlBlockMappingKey'
457 let g:vim_markdown_frontmatter=0
459 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
467 Execute (YAML frontmatter only works if it's the first thing in the file):
468 let g:vim_markdown_frontmatter=1
470 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
479 Execute (rules are not mistaken by YAML frontmatter delimiters):
480 let g:vim_markdown_frontmatter=1
482 AssertEqual SyntaxAt(5, 1), 'mkdRule'
493 Execute (header title starts with #):
494 AssertEqual SyntaxOf('a'), 'htmlH1'
495 AssertEqual SyntaxOf('b'), 'htmlH2'
510 ## h2 trailing hash ##
516 ### h3 trailing hash ###
524 Execute (atx headers):
525 AssertEqual SyntaxOf('# h1 space'), 'htmlH1'
526 AssertEqual SyntaxOf('#h1 nospace'), 'htmlH1'
527 AssertEqual SyntaxOf('# h1 2 spaces'), 'htmlH1'
528 AssertEqual SyntaxOf('# h1 trailing hash #'), 'htmlH1'
529 AssertEqual SyntaxOf('## h2 space'), 'htmlH2'
530 AssertEqual SyntaxOf('##h2 nospace'), 'htmlH2'
531 AssertEqual SyntaxOf('## h2 trailing hash ##'), 'htmlH2'
532 AssertEqual SyntaxOf('### h3 space'), 'htmlH3'
533 AssertEqual SyntaxOf('###h3 nospace'), 'htmlH3'
534 AssertEqual SyntaxOf('### h3 trailing hash ###'), 'htmlH3'
535 AssertEqual SyntaxOf('#### h4'), 'htmlH4'
536 AssertEqual SyntaxOf('##### h5'), 'htmlH5'
537 AssertEqual SyntaxOf('###### h6'), 'htmlH6'
546 Execute (atx headers relative positions):
547 AssertEqual SyntaxOf('# h1 before h2'), 'htmlH1'
548 AssertEqual SyntaxOf('## h2 between h1s'), 'htmlH2'
549 AssertEqual SyntaxOf('# h1 after h2'), 'htmlH1'
558 setex h1 single punctuation
561 setex h1 punctuation longer than header
562 ================================
564 Execute (setex headers):
565 AssertEqual SyntaxOf('setex h1'), 'htmlH1'
566 AssertEqual SyntaxOf('^========$'), 'htmlH1'
567 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
568 AssertEqual SyntaxOf('--------'), 'htmlH2'
569 AssertEqual SyntaxOf('setex h1 single punctuation'), 'htmlH1'
570 AssertEqual SyntaxOf('^=$'), 'htmlH1'
571 AssertEqual SyntaxOf('setex h1 punctuation longer than header'), 'htmlH1'
572 AssertEqual SyntaxOf('^================================$'), 'htmlH1'
578 Execute (prevent list vs Setex confusion):
579 AssertNotEqual SyntaxOf('- not Setex'), 'htmlH2'
580 AssertNotEqual SyntaxOf('- becuase list'), 'htmlH2'
597 Execute (mixed atx and setex headers):
598 AssertEqual SyntaxOf('setex h1 before atx'), 'htmlH1'
599 AssertEqual SyntaxOf('==================='), 'htmlH1'
600 AssertEqual SyntaxOf('## atx h2'), 'htmlH2'
601 AssertEqual SyntaxOf('### atx h3'), 'htmlH3'
602 AssertEqual SyntaxOf('# atx h1'), 'htmlH1'
603 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
604 AssertEqual SyntaxOf('------------------'), 'htmlH2'
612 Execute (& and > are not marked as htmlError in lists):
613 AssertEqual SyntaxOf('-'), 'mkdListItem'
614 AssertEqual SyntaxOf('1.'), 'mkdListItem'
615 AssertNotEqual SyntaxOf('&'), 'htmlError'
616 AssertNotEqual SyntaxOf('>'), 'htmlError'
627 Execute (HTML tag in text):
628 AssertEqual SyntaxOf('p'), 'htmlTagName'
629 AssertEqual SyntaxOf('<p>'), 'htmlTag'
630 AssertEqual SyntaxOf('</p>'), 'htmlEndTag'
631 AssertEqual SyntaxOf('span'), 'htmlTagName'
632 AssertEqual SyntaxOf('<span>'), 'htmlTag'
633 AssertEqual SyntaxOf('</span>'), 'htmlEndTag'