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 (bold with escaped underscores):
62 AssertNotEqual SyntaxOf('a'), 'htmlBold'
63 AssertEqual SyntaxOf('b'), 'htmlBold'
64 AssertEqual SyntaxOf('c'), 'htmlBold'
65 AssertNotEqual SyntaxOf('d'), 'htmlBold'
72 Execute (link with title):
73 AssertEqual SyntaxOf('a'), 'mkdLink'
74 AssertEqual SyntaxOf('b'), 'mkdURL'
81 Execute (parenthesis not in link):
82 AssertNotEqual SyntaxOf('a'), 'mkdURL'
83 AssertNotEqual SyntaxOf('b'), 'mkdURL'
88 Execute (multiple links on a line):
89 AssertNotEqual SyntaxOf('c'), 'mkdLink'
90 AssertNotEqual SyntaxOf('c'), 'mkdURL'
98 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
99 AssertEqual SyntaxOf('<'), 'mkdDelimiter'
100 AssertEqual SyntaxOf('b'), 'mkdInlineURL'
101 AssertEqual SyntaxOf('>'), 'mkdDelimiter'
102 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
107 Execute (autolink with scheme case is insensitive):
108 AssertEqual SyntaxOf('a'), 'mkdInlineURL'
113 Execute (autolink without known scheme is not a link):
114 AssertNotEqual SyntaxOf('n'), 'mkdInlineURL'
119 Execute (autolink without scheme is not a link):
120 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
128 Execute (autolink with space is not a link):
129 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
130 AssertNotEqual SyntaxOf('b'), 'mkdInlineURL'
131 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
132 AssertNotEqual SyntaxOf('d'), 'mkdInlineURL'
133 AssertNotEqual SyntaxOf('e'), 'mkdInlineURL'
138 Execute (autolinks can be backslash escaped):
139 AssertNotEqual SyntaxOf('<'), 'mkdDelimiter'
144 Execute (autolink in parenthesis):
145 AssertNotEqual SyntaxOf('a'), 'mkdInlineURL'
146 AssertEqual SyntaxOf('('), 'mkdDelimiter'
147 AssertEqual SyntaxOf('b'), 'mkdInlineURL'
148 AssertEqual SyntaxOf(')'), 'mkdDelimiter'
149 AssertNotEqual SyntaxOf('c'), 'mkdInlineURL'
152 [![a](http://b)](http://c)
154 Execute (autolink in link text):
155 AssertEqual SyntaxOf('!'), 'mkdDelimiter'
156 AssertEqual SyntaxOf('a'), 'mkdLink'
157 AssertEqual SyntaxOf('b'), 'mkdURL'
158 AssertEqual SyntaxOf('c'), 'mkdURL'
167 Execute (code blocks can be fenced with tildes):
168 AssertEqual SyntaxOf('c'), 'mkdCode'
175 Execute (code blocks can be fenced with tildes longer than 3):
176 AssertEqual SyntaxOf('c'), 'mkdCode'
183 Execute (code blocks can be fenced with backticks longer than 3):
184 AssertEqual SyntaxOf('c'), 'mkdCode'
191 Execute (code blocks can have a language specifier):
192 AssertEqual SyntaxOf('c'), 'mkdCode'
201 Execute (code blocks can be fenced with backticks and a language specifier):
202 AssertEqual SyntaxOf('code'), 'mkdCode'
203 AssertNotEqual SyntaxOf('text'), 'mkdCode'
213 Execute (indent code blocks):
214 AssertNotEqual SyntaxOf('a'), 'mkdCode'
215 AssertEqual SyntaxOf('b'), 'mkdCode'
216 AssertEqual SyntaxOf('c'), 'mkdCode'
225 Execute (indent code blocks after header):
226 AssertNotEqual SyntaxOf('a'), 'mkdCode'
227 AssertNotEqual SyntaxOf('b'), 'mkdCode'
228 AssertEqual SyntaxOf('c'), 'mkdCode'
237 Execute (indent code blocks after list):
238 AssertNotEqual SyntaxOf('a'), 'mkdCode'
239 AssertNotEqual SyntaxOf('b'), 'mkdCode'
240 AssertEqual SyntaxOf('c'), 'mkdCode'
253 Execute (fenced code block syntax with a language specifier):
254 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'Markdown_refresh_syntax')
256 AssertEqual SyntaxOf('include'), 'cInclude'
257 AssertEqual SyntaxOf('code'), 'mkdSnippetCPP'
258 AssertEqual SyntaxOf('def'), 'rubyDefine'
265 Execute (fenced code block syntax with an unknown language specifier):
266 let b:func = Markdown_GetFunc('vim-markdown/ftplugin/markdown.vim', 'Markdown_refresh_syntax')
268 AssertEqual SyntaxOf('code'), 'mkdSnippetA_B_'
278 Execute (first = or - in fenced code block is not setex headers):
279 AssertEqual SyntaxOf('='), 'mkdCode'
280 AssertEqual SyntaxOf('-'), 'mkdCode'
291 AssertNotEqual SyntaxOf('x'), 'mkdMath'
292 AssertNotEqual SyntaxOf('y'), 'mkdMath'
293 let g:vim_markdown_math=1
295 AssertNotEqual SyntaxOf('a'), 'mkdMath'
296 AssertNotEqual SyntaxOf('b'), 'mkdMath'
297 AssertNotEqual SyntaxOf('c'), 'mkdMath'
298 AssertNotEqual SyntaxOf('d'), 'mkdMath'
299 AssertNotEqual SyntaxOf('e'), 'mkdMath'
300 AssertNotEqual SyntaxOf('f'), 'mkdMath'
301 AssertEqual SyntaxOf('x'), 'mkdMath'
302 AssertEqual SyntaxOf('y'), 'mkdMath'
303 let g:vim_markdown_math=0
305 AssertNotEqual SyntaxOf('x'), 'mkdMath'
306 AssertNotEqual SyntaxOf('y'), 'mkdMath'
317 Execute (multiline math):
318 let g:vim_markdown_math=1
320 AssertNotEqual SyntaxOf('a'), 'mkdMath'
321 AssertEqual SyntaxOf('b'), 'mkdMath'
322 AssertNotEqual SyntaxOf('c'), 'mkdMath'
328 Execute (math tex highlighting):
329 let g:vim_markdown_math=0
331 AssertNotEqual SyntaxOf('sqrt'), 'texStatement'
332 AssertNotEqual SyntaxOf('frac'), 'texStatement'
333 let g:vim_markdown_math=1
335 AssertEqual SyntaxOf('sqrt'), 'texStatement'
336 AssertEqual SyntaxOf('frac'), 'texStatement'
345 Execute (YAML frontmatter is controlled by the option):
346 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
347 let g:vim_markdown_frontmatter=1
349 AssertEqual SyntaxOf('a'), 'yamlBlockMappingKey'
350 let g:vim_markdown_frontmatter=0
352 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
360 Execute (YAML frontmatter only works if it's the first thing in the file):
361 let g:vim_markdown_frontmatter=1
363 AssertNotEqual SyntaxOf('a'), 'yamlBlockMappingKey'
372 Execute (rules are not mistaken by YAML frontmatter delimiters):
373 let g:vim_markdown_frontmatter=1
375 AssertEqual SyntaxAt(5, 1), 'mkdRule'
386 Execute (header title starts with #):
387 AssertEqual SyntaxOf('a'), 'htmlH1'
388 AssertEqual SyntaxOf('b'), 'htmlH2'
403 ## h2 trailing hash ##
409 ### h3 trailing hash ###
417 Execute (atx headers):
418 AssertEqual SyntaxOf('# h1 space'), 'htmlH1'
419 AssertEqual SyntaxOf('#h1 nospace'), 'htmlH1'
420 AssertEqual SyntaxOf('# h1 2 spaces'), 'htmlH1'
421 AssertEqual SyntaxOf('# h1 trailing hash #'), 'htmlH1'
422 AssertEqual SyntaxOf('## h2 space'), 'htmlH2'
423 AssertEqual SyntaxOf('##h2 nospace'), 'htmlH2'
424 AssertEqual SyntaxOf('## h2 trailing hash ##'), 'htmlH2'
425 AssertEqual SyntaxOf('### h3 space'), 'htmlH3'
426 AssertEqual SyntaxOf('###h3 nospace'), 'htmlH3'
427 AssertEqual SyntaxOf('### h3 trailing hash ###'), 'htmlH3'
428 AssertEqual SyntaxOf('#### h4'), 'htmlH4'
429 AssertEqual SyntaxOf('##### h5'), 'htmlH5'
430 AssertEqual SyntaxOf('###### h6'), 'htmlH6'
439 Execute (atx headers relative positions):
440 AssertEqual SyntaxOf('# h1 before h2'), 'htmlH1'
441 AssertEqual SyntaxOf('## h2 between h1s'), 'htmlH2'
442 AssertEqual SyntaxOf('# h1 after h2'), 'htmlH1'
451 setex h1 single punctuation
454 setex h1 punctuation longer than header
455 ================================
457 Execute (setex headers):
458 AssertEqual SyntaxOf('setex h1'), 'htmlH1'
459 AssertEqual SyntaxOf('^========$'), 'htmlH1'
460 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
461 AssertEqual SyntaxOf('--------'), 'htmlH2'
462 AssertEqual SyntaxOf('setex h1 single punctuation'), 'htmlH1'
463 AssertEqual SyntaxOf('^=$'), 'htmlH1'
464 AssertEqual SyntaxOf('setex h1 punctuation longer than header'), 'htmlH1'
465 AssertEqual SyntaxOf('^================================$'), 'htmlH1'
471 Execute (prevent list vs Setex confusion):
472 AssertNotEqual SyntaxOf('- not Setex'), 'htmlH2'
473 AssertNotEqual SyntaxOf('- becuase list'), 'htmlH2'
490 Execute (mixed atx and setex headers):
491 AssertEqual SyntaxOf('setex h1 before atx'), 'htmlH1'
492 AssertEqual SyntaxOf('==================='), 'htmlH1'
493 AssertEqual SyntaxOf('## atx h2'), 'htmlH2'
494 AssertEqual SyntaxOf('### atx h3'), 'htmlH3'
495 AssertEqual SyntaxOf('# atx h1'), 'htmlH1'
496 AssertEqual SyntaxOf('setex h2'), 'htmlH2'
497 AssertEqual SyntaxOf('------------------'), 'htmlH2'
505 Execute (& and > are not marked as htmlError in lists):
506 AssertEqual SyntaxOf('-'), 'mkdListItem'
507 AssertEqual SyntaxOf('1.'), 'mkdListItem'
508 AssertNotEqual SyntaxOf('&'), 'htmlError'
509 AssertNotEqual SyntaxOf('>'), 'htmlError'
520 Execute (HTML tag in text):
521 AssertEqual SyntaxOf('p'), 'htmlTagName'
522 AssertEqual SyntaxOf('<p>'), 'htmlTag'
523 AssertEqual SyntaxOf('</p>'), 'htmlEndTag'
524 AssertEqual SyntaxOf('span'), 'htmlTagName'
525 AssertEqual SyntaxOf('<span>'), 'htmlTag'
526 AssertEqual SyntaxOf('</span>'), 'htmlEndTag'