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

CSS Validator throws an exception with invalid CSS #246

Closed
zdavis opened this Issue Apr 12, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@zdavis
Member

zdavis commented Apr 12, 2017

Attempting to ingest the wasteland text in api/spec/data/epubs/v3/wasteland.epub triggers an exception in the CSS validator.

In the EPUB's stylesheet, there is a declaration with a *[epub|type~='dedication'] selector:

*[epub|type~='dedication'] {
    padding-left: 2em;
}

The Validator::Stylesheet class reads the tag in this selector as TAG_='DEDICATION'], and tries to look up a constant named TAG_='DEDICATION']_CSS_PROPERTY_BLACKLIST in the CSS_PROPERTY_BLACKLIST based on this. This in turn throws a NameError exception in const_defined?

We need to improve the performance of the rightmost_selection method, and we need to catch NameError exceptions here and just return blacklist if it's shown.

@zdavis zdavis added the bug label Apr 12, 2017

@zdavis

This comment has been minimized.

Show comment
Hide comment
@zdavis

zdavis Apr 12, 2017

Member

Related to #245

Member

zdavis commented Apr 12, 2017

Related to #245

@zdavis zdavis added this to the v0.1.4 milestone Apr 14, 2017

@zdavis

This comment has been minimized.

Show comment
Hide comment
@zdavis

zdavis Apr 14, 2017

Member

@SMaxOwok I started a PR for this with a fix for the rightmost selection issue — #260

Member

zdavis commented Apr 14, 2017

@SMaxOwok I started a PR for this with a fix for the rightmost selection issue — #260

zdavis added a commit that referenced this issue Apr 18, 2017

[F] Refactor stylesheet and tag validator
Moves configuration from constants to config/manifold.yml
Fixes #246

@zdavis zdavis closed this in ca075d7 Apr 18, 2017

zdavis added a commit that referenced this issue Apr 21, 2017

[F] Refactor stylesheet and tag validator
Moves configuration from constants to config/manifold.yml
Fixes #246
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment