Remove useless line in Toc funciton.
--- /dev/null
+language: vim
+
+install: |
+ sudo apt-get update
+ sudo apt-get install vim
+ cd ..
+ git clone https://github.com/godlygeek/tabular
+ git clone https://github.com/junegunn/vader.vim
+
+script: |
+ cd "$TRAVIS_BUILD_DIR"
+ ./test/run-tests.sh
# Tests
-All new features must have tests. We don't require unit tests: tests that require users to open markdown code in Vim and check things manually are accepted, but you should point clearly to where the tests are.
-
-Wherever possible, use test cases from the [karlcow's Markdown Test Suite](https://github.com/karlcow/markdown-testsuite), and link to the relevant test files on your merge request.
-
-If a test does not exist there yet, make a pull request to them, and link to that pull request on the pull request you make here.
-
-If the test you want to do is not appropriate for the Markdown Test Suite, create it only under the `test/` directory here.
-
-If we start disagreeing too often on what is appropriate or not, we will fork off that repository.
+All new features must have unit tests.
# Markdown Vim Mode
+[![Build Status](https://travis-ci.org/plasticboy/vim-markdown.svg)](https://travis-ci.org/plasticboy/vim-markdown)
+
Syntax highlighting, matching rules and mappings for [the original Markdown](http://daringfireball.net/projects/markdown/) and extensions.
## Installation
let g:vim_markdown_no_default_key_mappings=1
```
+**Syntax extensions**
+
+The following options control which syntax extensions will be turned on.
+
+LaTeX math: `$ $`, `$$ $$`, escapable as `\$ \$` and `\$\$ \$\$`:
+
+```vim
+let g:vim_markdown_math=1
+```
## Mappings
The following work on normal and visual modes:
syn match htmlH1 /^.\+\n=\+$/ contains=@Spell
syn match htmlH2 /^.\+\n-\+$/ contains=@Spell
-syn cluster mkdNonListItem contains=htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdID,mkdURL,mkdLink,mkdLinkDef,mkdLineBreak,mkdBlockquote,mkdCode,mkdIndentCode,mkdListItem,mkdRule,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6
+if get(g:, 'vim_markdown_math', 0)
+ syn region mkdMath matchgroup=mkdDelimiter start="\\\@<!\$" end="\$"
+ syn region mkdMath matchgroup=mkdDelimiter start="\\\@<!\$\$" end="\$\$"
+endif
+
+syn cluster mkdNonListItem contains=htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdID,mkdURL,mkdLink,mkdLinkDef,mkdLineBreak,mkdBlockquote,mkdCode,mkdMath,mkdIndentCode,mkdListItem,mkdRule,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6
"highlighting for Markdown groups
HtmlHiLink mkdString String
HtmlHiLink mkdLinkDef mkdID
HtmlHiLink mkdLinkDefTarget mkdURL
HtmlHiLink mkdLinkTitle htmlString
-
+HtmlHiLink mkdMath Statement
HtmlHiLink mkdDelimiter Delimiter
" Automatically insert bullets
--- /dev/null
+To run the tests, you must install [Vader](https://github.com/junegunn/vader.vim).
+
+Vader and other plugins must be installed in the same directory as this repository.
+
+Run the tests with:
+
+ ./run-tests.sh
--- /dev/null
+#!/usr/bin/env bash
+
+cd "$( dirname "${BASH_SOURCE[0]}" )" && vim -Nu vimrc -c 'Vader! *' > /dev/null
0
end
```
+
+# Links
+
+[a](b "c")
+
+[a]()
+
+[good spell](a)
+
+[badd spell](a)
+
+[a](b "c")
+
+[a]( b
+"c" )
+
+a (`a`) b. Fix: <https://github.com/plasticboy/vim-markdown/issues/113>
+
+Escaped:
+
+\[a](b)
+
+[a\]b](c)
+
+## Known failures
+
+Escape does not work:
+
+[a\](b)
+
+Should not be links because of whitespace:
+
+[a] (b)
+
+[a](a
+b)
+
+[a](a b)
+
+# Reference links
+
+Single links:
+
+[a][b]
+
+[good spell][a]
+
+[badd spell][a]
+
+[a][]
+
+[a] []
+
+[a][b] c [d][e]
+
+Reference link followed by inline link:
+
+[a] [b](c)
+
+## Known failures
+
+Should be shortcut reference links:
+
+[a]
+
+[a] b [c]
+
+Should be a single link:
+
+[a] [b]
+
+[a] b [c](d)
--- /dev/null
+Given mkd (bold);
+**bold** not bold
+
+Execute (SyntaxOf(pattern)):
+ AssertEqual SyntaxOf('b'), 'htmlBold'
+
+Given mkd (italic);
+*italic*
+
+Execute (SyntaxOf(pattern)):
+ AssertEqual SyntaxOf('i'), 'htmlItalic'
+
+# Links
+
+Given mkd;
+[a](b)
+
+Execute (link with title):
+ AssertEqual SyntaxOf('a'), 'mkdLink'
+ AssertEqual SyntaxOf('b'), 'mkdURL'
+
+Given mkd;
+(a)
+
+Execute (parenthesis not in link):
+ AssertNotEqual SyntaxOf('a'), 'mkdLink'
+
+Given mkd;
+[a](b) c [d](e)
+
+Execute (multiple links on a line):
+ AssertEqual SyntaxOf('c'), ''
+
+# Math
+
+Given mkd;
+a $x$ b
+c $$y$$ d
+\$e\$
+\$\$f\$\$
+
+Execute (math):
+ AssertNotEqual SyntaxOf('x'), 'mkdMath'
+ AssertNotEqual SyntaxOf('y'), 'mkdMath'
+ let g:vim_markdown_math=1
+ syn off | syn on
+ AssertNotEqual SyntaxOf('a'), 'mkdMath'
+ AssertNotEqual SyntaxOf('b'), 'mkdMath'
+ AssertNotEqual SyntaxOf('c'), 'mkdMath'
+ AssertNotEqual SyntaxOf('d'), 'mkdMath'
+ AssertNotEqual SyntaxOf('e'), 'mkdMath'
+ AssertNotEqual SyntaxOf('f'), 'mkdMath'
+ AssertEqual SyntaxOf('x'), 'mkdMath'
+ AssertEqual SyntaxOf('y'), 'mkdMath'
+ let g:vim_markdown_math=0
+ syn off | syn on
+ AssertNotEqual SyntaxOf('x'), 'mkdMath'
+ AssertNotEqual SyntaxOf('y'), 'mkdMath'
+
+Given mkd;
+a
+
+$
+b
+$
+
+c
+
+Execute (multiline math):
+ let g:vim_markdown_math=1
+ syn off | syn on
+ AssertNotEqual SyntaxOf('a'), 'mkdMath'
+ AssertEqual SyntaxOf('b'), 'mkdMath'
+ AssertNotEqual SyntaxOf('c'), 'mkdMath'
--- /dev/null
+set nocompatible
+set rtp+=../
+set rtp+=../../tabular/
+set rtp+=../../vader.vim/
+filetype on
+filetype plugin on
+filetype indent on
+syntax on