mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-28 22:02:31 +08:00
Add htmlbeautifier support (#4751)
This commit is contained in:
@@ -561,6 +561,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['html', 'htmldjango'],
|
||||
\ 'description': 'Fix HTML files with html-beautify from js-beautify.',
|
||||
\ },
|
||||
\ 'htmlbeautifier': {
|
||||
\ 'function': 'ale#fixers#htmlbeautifier#Fix',
|
||||
\ 'suggested_filetypes': ['eruby'],
|
||||
\ 'description': 'Fix ERB files with htmlbeautifier gem.',
|
||||
\ },
|
||||
\ 'lua-format': {
|
||||
\ 'function': 'ale#fixers#lua_format#Fix',
|
||||
\ 'suggested_filetypes': ['lua'],
|
||||
|
||||
13
autoload/ale/fixers/htmlbeautifier.vim
Normal file
13
autoload/ale/fixers/htmlbeautifier.vim
Normal file
@@ -0,0 +1,13 @@
|
||||
" Author: Arash Mousavi <arash-m>
|
||||
" Description: Support for HTML Beautifier https://github.com/threedaymonk/htmlbeautifier
|
||||
|
||||
call ale#Set('eruby_htmlbeautifier_executable', 'htmlbeautifier')
|
||||
|
||||
function! ale#fixers#htmlbeautifier#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'eruby_htmlbeautifier_executable')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user