htmlq icon indicating copy to clipboard operation
htmlq copied to clipboard

Option to edit file in-place

Open mcandre opened this issue 2 years ago • 0 comments

Hi,

I like the idea of htmlq, as overall I find both xmlstarlet and tidy(-html5) and to be fairly cumbersome and antiquated. And sed, of course, is not up to the challenge of accurately performing complex edits to (X)HTML documents.

However, xmlstarlet, tidy-html5 and sed all offer command line flags for in-place editing, which is super helpful when recursing over large directories in the context of an automated shell script.

Can we please add an optional flag to output the changes back to the same input file?

Perhaps there is already a flag for in-place editing, and I may have missed this somehow :)

As a workaround, one could write to a designated temporary output file path, then manually cp the temp file onto the original input file path.

mcandre avatar Feb 04 '23 07:02 mcandre