mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-30 08:04:31 +08:00
Add pandoc as a markdown fixer (#3641)
Utilize pandoc to fix markdown files, currently set to Github-Flavored Markdown, but that can be changed by setting, ale_markdown_pandoc_options.
This commit is contained in:
23
test/fixers/test_pandoc_fixer_callback.vader
Normal file
23
test/fixers/test_pandoc_fixer_callback.vader
Normal file
@@ -0,0 +1,23 @@
|
||||
Before:
|
||||
Save g:ale_markdown_pandoc_executable
|
||||
Save g:ale_markdown_pandoc_options
|
||||
|
||||
After:
|
||||
Restore
|
||||
|
||||
Execute(The pandoc callback should return 'pandoc' as default command):
|
||||
setlocal noexpandtab
|
||||
Assert
|
||||
\ ale#fixers#pandoc#Fix(bufnr('')).command =~# '^' . ale#Escape('pandoc'),
|
||||
\ "Default command name is expected to be 'pandoc'"
|
||||
|
||||
Execute(The pandoc executable and options should be configurable):
|
||||
let g:ale_markdown_pandoc_executable = 'foobar'
|
||||
let g:ale_markdown_pandoc_options = '--some-option'
|
||||
|
||||
AssertEqual
|
||||
\ {
|
||||
\ 'command': ale#Escape('foobar')
|
||||
\ . ' --some-option',
|
||||
\ },
|
||||
\ ale#fixers#pandoc#Fix(bufnr(''))
|
||||
Reference in New Issue
Block a user