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

Parser chokes on quoted semicolon #47

Closed
lidavidm opened this issue Mar 14, 2012 · 1 comment
Closed

Parser chokes on quoted semicolon #47

lidavidm opened this issue Mar 14, 2012 · 1 comment

Comments

@lidavidm
Copy link

This is a minor issue, but a Lucius rule like this:

li {
    content: ";";
}

will give an error message like this:

(line 365, column 2):
unexpected end of input
expecting "/*", "}", "#", "@" or "{"
checkIfBlock

where the error message doesn't occur until the last line.

The parser doesn't seem to recognize that the semicolon is quoted. I tried "\;" but that has no effect. I believe CSS allows semicolons in strings and also allows backslash escaping (http://www.w3.org/TR/CSS2/syndata.html#characters).

I am using Shakespeare version shakespeare-0.10.3.1.

@snoyberg
Copy link
Member

snoyberg commented Jul 5, 2012

Sorry for the delay in responding to this, it slipped between the cracks.

Unfortunately, it's a bit more complicated in Lucius, since it's entirely possible to include the close quote in a variable interpolation, e.g.:

li {
    content: ";#{quote};
}

Maybe we want to say that's a ridiculous case that should be ignored, but that's a decision we need to make since doing so could in theory break code. (It probably has larger effects than just this degenerate case.)

As a temporary workaround, you can do something like this:

li {
    content: "#{";"}";
}

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