Add htmlbeautifier support (#4751)

This commit is contained in:
Arash Mousavi
2024-04-17 15:58:28 +01:00
committed by GitHub
parent 6db58b3379
commit 7516e2e484
7 changed files with 53 additions and 0 deletions

View File

@@ -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'],

View 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