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

'check css' isn't showing the information associated with Parse Errors #484

Closed
dgmstuart opened this issue Oct 10, 2014 · 3 comments
Closed
Milestone

Comments

@dgmstuart
Copy link

When running nanoc check css on https://github.com/dgmstuart/dgms_cv I get the following mystery errors:

Issues found!
  output/stylesheets/styles.css:
    [ ERROR ] css - Parse Error
    [ ERROR ] css - Parse Error

Running my output css through the W3C CSS validator site I can see the source of the problem (apparently the validator currently chokes on the @page selector - used in print stylesheets):

Parse Error @page { margin: 1.2cm; }
Parse Error }

It would be nice if nanoc could display this information as well.

@denisdefreyne
Copy link
Member

The w3c_validators gem doesn’t return that data in a ready-to-use format, but it does return the lines on which the error occurred, so that should give enough information (hopefully) to create a better error message:

#<W3CValidators::Results:0x007fbe950506f8
  @messages=[
    #<W3CValidators::Message:0x007fbe95058da8
    @type=:error,
    @uri="file://localhost/TextArea",
    @line="1",
    @col=nil,
    @source=nil,
    @explanation=nil,
    @message="\n        \n                                Parse Error\n                            ",
    @message_id=nil,
    @message_count=nil,
    @element=nil,
    @parent=nil,
    @value=nil,
    @level=nil>],
  @uri="file://localhost/TextArea",
  @checked_by="http://jigsaw.w3.org/css-validator/",
  @doctype=nil,
  @css_level="css3",
  @charset=nil,
  @validity=false,
  @debug_messages={}
>
@denisdefreyne
Copy link
Member

Fixed by #504. This will be in the next patch release (3.7.5)!

@dgmstuart
Copy link
Author

Great :)

denisdefreyne added a commit that referenced this issue Jan 11, 2015
denisdefreyne added a commit that referenced this issue Jan 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants