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

Recusion causes RangeError on badly formed css #56

Open
deepwell opened this issue Dec 12, 2014 · 1 comment
Open

Recusion causes RangeError on badly formed css #56

deepwell opened this issue Dec 12, 2014 · 1 comment

Comments

@deepwell
Copy link

Unfortunately my app has to be able to parse a stylesheet that has almost a hundred lines that look like this:
@media only screen and (max-width:480px){td[id=cellBody]{padding:10px}
That repeats a couple of hundred times. Totals about 20,000 lines of this. Yes very badly formed. If you look closely you can see that each additional css declaration to be nested in the one above it because it opens 2 brackets and only closes 1 of them.

Handing this to css.parse() causes node.js to run out of call stack space (on my computer the max size is 10483) and emit a
RangeError: Maximum call stack size exceeded

I'm working around this in my app, but I'm bringing this to your attention as you may want to detect and handle this edge case in this library.

@ai
Copy link

ai commented Dec 12, 2014

BTW, can you test PostCSS with this bad and big CSS. I need a parsing time :).

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