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

Skip all spaces around and inside tags #59

Closed

Conversation

infernalmaster
Copy link

@infernalmaster infernalmaster commented Mar 17, 2021

Changes:

  • all spaces are removed just like ReactJs does, so output code is almost minified
  • small refactoring for children nodes rendering
  • code inside javascript: and css: section is also minified so it pushes issues with JavaScript template literals even further. Before this change only empty lines inside template literals were remove, but now almost all spaces are removed inside them

I propose to add spaces using similar to ReactJS way: = " "
We can also use ' to add space after text

This change allow to fix that
#29
#42

Copy link
Owner

@jeromegn jeromegn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is on the right track, but how do we handle tags that should not be minified like <pre> where whitespace is important? We should add tests for that too.

@infernalmaster
Copy link
Author

infernalmaster commented Mar 18, 2021

You are right, so looks like we need to preserve original formatting for <pre> and <script>. Even right now master branch has problems with that because it's reformat everything to use double space and also skips all empty lines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants