mirror of
https://github.com/dense-analysis/ale.git
synced 2026-03-13 02:10:45 +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:
16
autoload/ale/fixers/pandoc.vim
Normal file
16
autoload/ale/fixers/pandoc.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
scriptencoding utf-8
|
||||
" Author: Jesse Hathaway <jesse@mbuki-mvuki.org>
|
||||
" Description: Fix markdown files with pandoc.
|
||||
|
||||
call ale#Set('markdown_pandoc_executable', 'pandoc')
|
||||
call ale#Set('markdown_pandoc_options', '-f gfm -t gfm -s -')
|
||||
|
||||
function! ale#fixers#pandoc#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'markdown_pandoc_executable')
|
||||
let l:options = ale#Var(a:buffer, 'markdown_pandoc_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' ' . l:options,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user