Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML minification breaks code formatting #61

Open
sc0ttj opened this issue May 19, 2019 · 2 comments
Open

HTML minification breaks code formatting #61

sc0ttj opened this issue May 19, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@sc0ttj
Copy link
Owner

sc0ttj commented May 19, 2019

To do

Fix the sed command at the bottom of .app/minify.sh, so that it excludes the contents of <pre> tags when minifying the HTML.

See here: https://unix.stackexchange.com/questions/519788/how-do-i-exclude-pre-tags-from-html-minification-using-sed

@sc0ttj sc0ttj added the bug Something isn't working label May 19, 2019
@sc0ttj
Copy link
Owner Author

sc0ttj commented Jan 20, 2020

@sc0ttj
Copy link
Owner Author

sc0ttj commented Jan 20, 2020

sed ':a;$!{N;ba;};s/@/@a/g;s/\n/@n/g;s/<pre/\n&/g;s/<\/pre>/&\n/g' test.html \
  | sed -r '/(^<pre|<\/pre>$)/!{s/@n//g;s/>\s+</></g;}' \
  | sed ':a;$!{N;ba;};s/\n//g;s/@n/\n/g;s/@a/@/g' >min.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant