Okay, reworked the code. I am now taking full use of the find_all command. This means you can do some more complicated substitutions. I went ahead and committed as an example the replacements requested on the opening page.
{
"replacements": {
// Example replacements
"html5_remove_deprecated_type_attr": {
"find": "(<(style|script)^>]*)\\stype=(\"|')text/(css|javascript)(\"|')(^>]*>)",
"replace": "\\1\\6",
"greedy": true,
"case": false
},
"remove_html_comments": {
"find": "<!--\\s\\S]+?-->",
"replace": "",
"greedy": true,
"case": true
}
}
}
To access the commands, you simply define a command in the command palette. I have provided an example, and you can chain the replacements.
{
"caption": "Reg Replace: Example - Cleanup HTML",
"command": "reg_replace",
"args": {"replacements": "html5_remove_deprecated_type_attr", "remove_html_comments"]}
}
]
So the quick_panel is removed now.
Non-greedy searches are still limited to the first in the entire file. I plan on applying non-greedy changes from the cursor forward and allow wrapping, but not today.
As always, feedback, bug reports, and suggestions are appreciated.