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 (not italic with escaped asterisks):
37 AssertNotEqual SyntaxOf('a'), 'htmlItalic'
38 AssertNotEqual SyntaxOf('b'), 'htmlItalic'
39 AssertNotEqual SyntaxOf('c'), 'htmlItalic'
44 Execute (not italic with escaped underscores):
45 AssertNotEqual SyntaxOf('a'), 'htmlItalic'
46 AssertNotEqual SyntaxOf('b'), 'htmlItalic'
47 AssertNotEqual SyntaxOf('c'), 'htmlItalic'
52 Execute (italic with escaped underscores):
53 AssertNotEqual SyntaxOf('a'), 'htmlItalic'
54 AssertEqual SyntaxOf('b'), 'htmlItalic'
55 AssertEqual SyntaxOf('c'), 'htmlItalic'
56 AssertNotEqual SyntaxOf('d'), 'htmlItalic'
61 Execute (italic with escaped asterisks):
62 AssertNotEqual SyntaxOf('a'), 'htmlItalic'
63 AssertEqual SyntaxOf('b'), 'htmlItalic'
64 AssertEqual SyntaxOf('c'), 'htmlItalic'
65 AssertNotEqual SyntaxOf('d'), 'htmlItalic'
70 Execute (bold with escaped underscores):
71 AssertNotEqual SyntaxOf('a'), 'htmlBold'
72 AssertEqual SyntaxOf('b'), 'htmlBold'
73 AssertEqual SyntaxOf('c'), 'htmlBold'
74 AssertNotEqual SyntaxOf('d'), 'htmlBold'
81 Execute (link with title):
82 AssertEqual SyntaxOf('a'), 'mkdLink'
83 AssertEqual SyntaxOf('b'), 'mkdURL'
90 Execute (parenthesis not in link):
91 AssertNotEqual SyntaxOf('a'), 'mkdURL'
92 AssertNotEqual SyntaxOf('b'), 'mkdURL'
97 Execute (multiple links on a line):
98 AssertNotEqual SyntaxOf('c'), 'mkdLink'
99 AssertNotEqual SyntaxOf('c'), 'mkdURL'
104 Execute (conceal link):
105 setlocal conceallevel=2
106 AssertEqual synconcealed(1, 1)[0], 1
107 AssertEqual synconcealed(1, 2)[0], 0
108 AssertEqual synconcealed(1, 3)[0], 1
109 AssertEqual synconcealed(1, 4)[0], 1
110 AssertEqual synconcealed(1, 4)[0], 1
111 AssertEqual synconcealed(1, 5)[0], 1
112 AssertEqual synconcealed(1, 6)[0], 1
113 setlocal conceallevel=0
121 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
122 AssertEqual SyntaxOf('<'), 'mkdDelimiter'
123 AssertEqual SyntaxOf('b'), 'mkdInlineURL'
124 AssertEqual SyntaxOf('>'), 'mkdDelimiter'
125 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
130 Execute (autolink with scheme case is insensitive):
131 AssertEqual SyntaxOf('a'), 'mkdInlineURL'
136 Execute (autolink without scheme is not a link):
137 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
145 Execute (autolink with space is not a link):
146 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
147 AssertNotEqual SyntaxOf('b'), 'mkdInlineURL'
148 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
149 AssertNotEqual SyntaxOf('d'), 'mkdInlineURL'
150 AssertNotEqual SyntaxOf('e'), 'mkdInlineURL'
155 Execute (autolinks can be backslash escaped):
156 AssertNotEqual SyntaxOf('<'), 'mkdDelimiter'
161 Execute (autolink in parenthesis):
162 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
163 AssertEqual SyntaxOf('('), 'mkdDelimiter'
164 AssertEqual SyntaxOf('b'), 'mkdInlineURL'
165 AssertEqual SyntaxOf(')'), 'mkdDelimiter'
166 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
169 [![a](http://b)](http://c)
171 Execute (autolink in link text):
172 AssertEqual SyntaxOf('!'), 'mkdDelimiter'
173 AssertEqual SyntaxOf('a'), 'mkdLink'
174 AssertEqual SyntaxOf('b'), 'mkdURL'
175 AssertEqual SyntaxOf('c'), 'mkdURL'
184 Execute (code blocks can be fenced with tildes):
185 AssertEqual SyntaxOf('c'), 'mkdCode'
192 Execute (code blocks can be fenced with tildes longer than 3):
193 AssertEqual SyntaxOf('c'), 'mkdCode'
200 Execute (code blocks can be fenced with backticks longer than 3):
201 AssertEqual SyntaxOf('c'), 'mkdCode'
208 Execute (code blocks can have a language specifier):
209 AssertEqual SyntaxOf('c'), 'mkdCode'
218 Execute (code blocks can be fenced with backticks and a language specifier):
219 AssertEqual SyntaxOf('code'), 'mkdCode'
220 AssertNotEqual SyntaxOf('text'), 'mkdCode'
230 Execute (indent code blocks):
231 AssertNotEqual SyntaxOf('a'), 'mkdCode'
232 AssertEqual SyntaxOf('b'), 'mkdCode'
233 AssertEqual SyntaxOf('c'), 'mkdCode'
242 Execute (indent code blocks after header):
243 AssertNotEqual SyntaxOf('a'), 'mkdCode'
244 AssertNotEqual SyntaxOf('b'), 'mkdCode'
245 AssertEqual SyntaxOf('c'), 'mkdCode'
254 Execute (indent code blocks after list):
255 AssertNotEqual SyntaxOf('a'), 'mkdCode'
256 AssertNotEqual SyntaxOf('b'), 'mkdCode'
257 AssertEqual SyntaxOf('c'), 'mkdCode'
270 Execute (fenced code block syntax with a language specifier):
271 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
273 AssertEqual SyntaxOf('include'), 'cInclude'
274 AssertEqual SyntaxOf('code'), 'mkdSnippetCPP'
275 AssertEqual SyntaxOf('def'), 'rubyDefine'
282 Execute (fenced code block syntax with an unknown language specifier):
283 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'MarkdownRefreshSyntax')
285 AssertEqual SyntaxOf('code'), 'mkdSnippetA_B_'
295 Execute (first = or - in fenced code block is not setex headers):
296 AssertEqual SyntaxOf('='), 'mkdCode'
297 AssertEqual SyntaxOf('-'), 'mkdCode'
308 AssertNotEqual SyntaxOf('x'), 'mkdMath'
309 AssertNotEqual SyntaxOf('y'), 'mkdMath'
310 let g:vim_markdown_math=1
312 AssertNotEqual SyntaxOf('a'), 'mkdMath'
313 AssertNotEqual SyntaxOf('b'), 'mkdMath'
314 AssertNotEqual SyntaxOf('c'), 'mkdMath'
315 AssertNotEqual SyntaxOf('d'), 'mkdMath'
316 AssertNotEqual SyntaxOf('e'), 'mkdMath'
317 AssertNotEqual SyntaxOf('f'), 'mkdMath'
318 AssertEqual SyntaxOf('x'), 'mkdMath'
319 AssertEqual SyntaxOf('y'), 'mkdMath'
320 let g:vim_markdown_math=0
322 AssertNotEqual SyntaxOf('x'), 'mkdMath'
323 AssertNotEqual SyntaxOf('y'), 'mkdMath'
334 Execute (multiline math):
335 let g:vim_markdown_math=1
337 AssertNotEqual SyntaxOf('a'), 'mkdMath'
338 AssertEqual SyntaxOf('b'), 'mkdMath'
339 AssertNotEqual SyntaxOf('c'), 'mkdMath'
345 Execute (math tex highlighting):
346 let g:vim_markdown_math=0
348 AssertNotEqual SyntaxOf('sqrt'), 'texStatement'
349 AssertNotEqual SyntaxOf('frac'), 'texStatement'
350 let g:vim_markdown_math=1
352 AssertEqual SyntaxOf('sqrt'), 'texStatement'
353 AssertEqual SyntaxOf('frac'), 'texStatement'
362 Execute (YAML frontmatter is controlled by the option):
363 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
364 let g:vim_markdown_frontmatter=1
366 AssertEqual SyntaxOf('a'), 'yamlBlockMappingKey'
367 let g:vim_markdown_frontmatter=0
369 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
377 Execute (YAML frontmatter only works if it's the first thing in the file):
378 let g:vim_markdown_frontmatter=1
380 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
389 Execute (rules are not mistaken by YAML frontmatter delimiters):
390 let g:vim_markdown_frontmatter=1
392 AssertEqual SyntaxAt(5, 1), 'mkdRule'
403 Execute (header title starts with #):
404 AssertEqual SyntaxOf('a'), 'htmlH1'
405 AssertEqual SyntaxOf('b'), 'htmlH2'
420 ## h2 trailing hash ##
426 ### h3 trailing hash ###
434 Execute (atx headers):
435 AssertEqual SyntaxOf('# h1 space'), 'htmlH1'
436 AssertEqual SyntaxOf('#h1 nospace'), 'htmlH1'
437 AssertEqual SyntaxOf('# h1 2 spaces'), 'htmlH1'
438 AssertEqual SyntaxOf('# h1 trailing hash #'), 'htmlH1'
439 AssertEqual SyntaxOf('## h2 space'), 'htmlH2'
440 AssertEqual SyntaxOf('##h2 nospace'), 'htmlH2'
441 AssertEqual SyntaxOf('## h2 trailing hash ##'), 'htmlH2'
442 AssertEqual SyntaxOf('### h3 space'), 'htmlH3'
443 AssertEqual SyntaxOf('###h3 nospace'), 'htmlH3'
444 AssertEqual SyntaxOf('### h3 trailing hash ###'), 'htmlH3'
445 AssertEqual SyntaxOf('#### h4'), 'htmlH4'
446 AssertEqual SyntaxOf('##### h5'), 'htmlH5'
447 AssertEqual SyntaxOf('###### h6'), 'htmlH6'
456 Execute (atx headers relative positions):
457 AssertEqual SyntaxOf('# h1 before h2'), 'htmlH1'
458 AssertEqual SyntaxOf('## h2 between h1s'), 'htmlH2'
459 AssertEqual SyntaxOf('# h1 after h2'), 'htmlH1'
468 setex h1 single punctuation
471 setex h1 punctuation longer than header
472 ================================
474 Execute (setex headers):
475 AssertEqual SyntaxOf('setex h1'), 'htmlH1'
476 AssertEqual SyntaxOf('^========$'), 'htmlH1'
477 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
478 AssertEqual SyntaxOf('--------'), 'htmlH2'
479 AssertEqual SyntaxOf('setex h1 single punctuation'), 'htmlH1'
480 AssertEqual SyntaxOf('^=$'), 'htmlH1'
481 AssertEqual SyntaxOf('setex h1 punctuation longer than header'), 'htmlH1'
482 AssertEqual SyntaxOf('^================================$'), 'htmlH1'
488 Execute (prevent list vs Setex confusion):
489 AssertNotEqual SyntaxOf('- not Setex'), 'htmlH2'
490 AssertNotEqual SyntaxOf('- becuase list'), 'htmlH2'
507 Execute (mixed atx and setex headers):
508 AssertEqual SyntaxOf('setex h1 before atx'), 'htmlH1'
509 AssertEqual SyntaxOf('==================='), 'htmlH1'
510 AssertEqual SyntaxOf('## atx h2'), 'htmlH2'
511 AssertEqual SyntaxOf('### atx h3'), 'htmlH3'
512 AssertEqual SyntaxOf('# atx h1'), 'htmlH1'
513 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
514 AssertEqual SyntaxOf('------------------'), 'htmlH2'
522 Execute (& and > are not marked as htmlError in lists):
523 AssertEqual SyntaxOf('-'), 'mkdListItem'
524 AssertEqual SyntaxOf('1.'), 'mkdListItem'
525 AssertNotEqual SyntaxOf('&'), 'htmlError'
526 AssertNotEqual SyntaxOf('>'), 'htmlError'
537 Execute (HTML tag in text):
538 AssertEqual SyntaxOf('p'), 'htmlTagName'
539 AssertEqual SyntaxOf('<p>'), 'htmlTag'
540 AssertEqual SyntaxOf('</p>'), 'htmlEndTag'
541 AssertEqual SyntaxOf('span'), 'htmlTagName'
542 AssertEqual SyntaxOf('<span>'), 'htmlTag'
543 AssertEqual SyntaxOf('</span>'), 'htmlEndTag'