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

Add @font-face messed test case and update parsing #57

Merged
merged 1 commit into from
Dec 17, 2014
Merged

Add @font-face messed test case and update parsing #57

merged 1 commit into from
Dec 17, 2014

Conversation

daleeidd
Copy link
Contributor

I was using a rework based preprocessor, and recently it wouldn't let me place my braces on the next line for the @font-face rule so I have updated the parsing with an accompanying test case.

@@ -461,7 +461,7 @@ module.exports = function(css, options){

function atfontface() {
var pos = position();
var m = match(/^@font-face */);
var m = match(/^@font-face( |\n)*/);
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't this use \s to select all whitespace?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, sorry. I am a bit rusty with my regular expressions. I will fix it up and rebase.

@conradz
Copy link
Contributor

conradz commented Dec 15, 2014

Thanks for catching this! It looks like basically all the other @ rules have the same problem. I can take care of fixing and adding tests for the others if you want.

@daleeidd
Copy link
Contributor Author

No worries. Yeah, sure thing. Did you use any tools to create the AST files?

@conradz
Copy link
Contributor

conradz commented Dec 16, 2014

I actually did have a small script that generated the AST files when I added them to all the tests, since the code wasn't being changed. When adding new tests they should definitely be reviewed carefully if they are auto-generated.

conradz added a commit that referenced this pull request Dec 17, 2014
Add @font-face messed test case and update parsing
@conradz conradz merged commit 1854d0c into reworkcss:master Dec 17, 2014
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.

None yet

2 participants