-
Notifications
You must be signed in to change notification settings - Fork 29
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
Switch to an AST based parser and builder #26
Conversation
According to reworkcss/css-parse#49 we need to remove any comments in property names and values manually for now. I'll update the patch according to this information. |
@@ -199,7 +199,7 @@ sink('media expressions', function (test, ok, b, a, assert) { | |||
test('should handle media declarations', function (done) { | |||
assert.equal( | |||
swap('@media (max-width: 320px) { #myid { margin-right: 1px; } .cls { padding-left: 3px; } } td { float: left; }'), | |||
'@media (max-width:320px){#myid{margin-left:1px;}.cls{padding-right:3px;}}td{float:right;}', | |||
'@media (max-width: 320px){#myid{margin-left:1px;}.cls{padding-right:3px;}}td{float:right;}', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where does this extra space come from after max-width
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently our new parser/builder combo does not split or compress that part. The space is in the original and it does not go away with compression.
this is a great change! this alleviates us from actually having to write the parser in R2 |
@@ -1,7 +1,7 @@ | |||
{ | |||
"name": "R2", | |||
"description": "a CSS LTR ∞ RTL converter", | |||
"version": "1.3.3", | |||
"version": "1.4.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we should do this 1.4.0 or 1.3.4
I think this can still be 1.3.4 since the interface doesn't change at all. What do you think @ded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we added a new dependency, it's fine to move up a minor version since this could alter how folks implemented the package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright then, I think this is ready for prime time :)
On Dec 8, 2013 10:16 PM, "Dustin Diaz" [email protected] wrote:
In package.json:
@@ -1,7 +1,7 @@
{
"name": "R2",
"description": "a CSS LTR ∞ RTL converter",
- "version": "1.3.3",
- "version": "1.4.0",
since we added a new dependency, it's fine to move up a minor version
since this could alter how folks implemented the package.—
Reply to this email directly or view it on GitHubhttps://github.com//pull/26/files#r8185911
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool. i'll leave it up to you to merge
Switch to an AST based parser and builder
Starts using visionmedia/css-parse and visionmedia/css-stringify for
parsing the source and building the results. This avoids the messy and
hard to modify RegExes used to parse the source and makes it easier to
address issues like #19 or #18, adds the ability to add source maps and
fixes #8.