This commit is contained in:
windwp 2021-06-09 20:43:17 +07:00
parent cb2d352beb
commit 0d7f288dae
5 changed files with 18 additions and 6 deletions

View File

@ -2,7 +2,7 @@
Use treesitter to **autoclose** and **autorename** html tag
It work with html,tsx,vue,svelte.
It work with html,tsx,vue,svelte,php.
## Usage

View File

@ -5,9 +5,9 @@ if _G.__is_log then
}
else
return{
debug = function() end,
info = function() end,
error = function() end,
debug = function(_) end,
info = function(_) end,
error = function(_) end,
}
end

View File

@ -8,6 +8,7 @@ local M = {}
M.tbl_filetypes = {
'html', 'javascript', 'typescript', 'javascriptreact', 'typescriptreact', 'svelte', 'vue', 'tsx', 'jsx',
'php',
'glimmer','handlebars','hbs'
}
@ -19,7 +20,7 @@ M.tbl_skipTag = {
local ERROR_TAG = "ERROR"
local HTML_TAG = {
filetypes = {'html'},
filetypes = {'html','php'},
start_tag_pattern = 'start_tag',
start_name_tag_pattern = 'tag_name',
end_tag_pattern = "end_tag",

View File

@ -21,7 +21,9 @@
</p>
</div>
<?php include("includes/footer.php");?>
</body>
</html>

View File

@ -177,6 +177,15 @@ local data = {
before = [[<Opt.Input| ]],
after = [[<Opt.Input>|</Opt.Input> ]]
},
{
name = "18 php div " ,
filepath = './sample/index.php',
filetype = "php",
linenr = 25,
key = [[>]],
before = [[<div| ]],
after = [[<div>|</div> ]]
},
}
local run_data = {}
for _, value in pairs(data) do