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

Duplicated semicolons generates exception in CSSParser::parseIdentifier #42

Closed
raffishquartan opened this issue Jul 12, 2012 · 1 comment

Comments

@raffishquartan
Copy link

Trying to parse the DokuWiki CSS file at the link below generates an exception in CSSParser::parseIdentifier() on line 115 with the message "Identifier expected, got ;widt".

CSS file link: http://www.syntilect.com/cgf/lib/exe/css.php

Examining the CSS file shows a duplicated semicolon (after right:237px). I suspect this is affecting the parser - will have a look and see if I can find an easy fix.

div.dokuwiki div.ajax_qsearch{position:absolute;right:237px;;width:200px;opacity:0.9;display:none;font-size:80%;line-height:1.2em;border:1px solid #8cacbb;background-color:#f7f9fa;text-align:left;padding:4px;}
@raffishquartan
Copy link
Author

A few more quick thoughts:

CSSParser::parseIdentifier throws an exception because CSSParser::parseCharacter returns null when asked to parse a ';' character. A very crude solution to this problem is to add the code:

while($this->peek() == ';') { $this->consume(); }

to the beginning of CSSParser::parseRule. A better solution might be to engineer the Rule parser to handle "empty rules" but I haven't had the time to look into the code enough to figure out how to make it do this... I'll leave the issue open for further discussion on this if nec.

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

No branches or pull requests

2 participants