commit | b9e1ed841a7b53cf4e9083aa7eab8cb58aaddf48 | [log] [tgz] |
---|---|---|
author | Leon Senft <leonsenft@users.noreply.github.com> | Wed May 17 19:00:22 2017 |
committer | GitHub <noreply@github.com> | Wed May 17 19:00:22 2017 |
tree | 90dfac5005f621f65431eba1ae7ea9de90c3b6f1 | |
parent | fe8d87e653c40e1afe20a87ed9fc8672f390dc01 [diff] |
Supports mixing /* */ and <!-- --> comments (#53) The tokenizer had no context of which kind of comment it was processing and would terminate upon seeing any comment ending. Fixes failing test added in #51.
This is a CSS parser written entirely in Dart. It can be used in the client/server/command line.
This package is installed with Pub, see: install instructions for this package.
Parsing CSS is easy!
import 'package:csslib/parser.dart' show parse; import 'package:csslib/css.dart'; main() { var stylesheet = parse( '.foo { color: red; left: 20px; top: 20px; width: 100px; height:200px }'); print(stylesheet.toString()); }
You can pass a String or list of bytes to parse
.
Basic tests can be found in this repository:
pub run test
The full CSS test suite can be found in https://github.com/dart-lang/csslib-test-suite
cd ../csslib-test-suite ./run.sh