Feature request: Option to strip/reduce all whitespace, not just in text.
Author: pbsdsCreated Apr 6, 2022Updated Jul 12, 2023
It would be nice to be able to collapse each match into a single line, for further filtering with tools like grep.
For example, when matching table rows, each row often span multiple lines, due to how the html was formatted.
My current workaround is to minify the html before passing it to htmlq (cat myfile.html | sd '\n' ' ' | tr -s ' ' | htmlq ...), but a simple switch in htmlq would make this way easier.
Not sure how this would be handled in tags like pre tough...
Source: mgdm/htmlq