codemirror-markdown-list-autoindent
v1.0.1
Published
CodeMirror patched with markdown list auto-indent
Downloads
3
Maintainers
Readme
CodeMirror-markdown-list-autoindent
This package is essentially a patch to CodeMirror that adds support for list auto-indentation in Markdown.
When continuing a list in Markdown, type <Tab>
to indent the next bullet or
<Shift-Tab>
to unindent it.
Example:
NPM
The package is on NPM:
$ npm install codemirror-markdown-list-autoindent
Usage
When including CodeMirror in your JS client, add the new indentlist.js
file:
<link rel="stylesheet" href="(path_to_code_mirror)/lib/codemirror.css">
<script src="(path_to_code_mirror)/lib/codemirror.js"></script>
<script src="(path_to_code_mirror)/addon/edit/continuelist.js"></script>
<script src="(path_to_code_mirror)/addon/edit/indentlist.js"></script>
<script src="(path_to_code_mirror)/mode/markdown.js"></script>
Then bind the <Tab>
and <Shift-Tab>
keys to the right events:
extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList",
"Tab": "autoIndentMarkdownList",
"Shift-Tab": "autoUnindentMarkdownList"}