-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
It's very common to compact css to single lines in tests, e.g.
.classname { font-weigth: bold; color: #f70; a { text-decoration: underline } }This is both valid css and less (lessc passes the compilation). Lessgo doesn't do so well since the parser is based on newline information, and doesn't consider braces or underscores when parsing documents.
The issue is generally easy to fix just by injecting some newlines after {, ;, } and also before } (the last statement ; is optional). The tooling should be able to consume "minified" sources.
TODOs:
- Replicate issue
- add a fixture test with single-line less source code
- expectation: lessc passes compilation
- expectation: lessgo errors
- Adjust implementation
- patch any css []byte into a well indented version ready for parsing, adding whitespace to sanitize the input
- make fixture test / integration test with lessc and lessgo pass, outputs must match
- Testing
- any existing tests should pass without modification to the test
- tests should not be skipped or otherwise disabled
- follow existing coding and testing conventions, testify/require usage
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels