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

Fix Issue 673: Parse error with named CSS grid lines and areas #643

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

blizzardengle
Copy link

This patch protects CSS named grids by replacing the brackets before any parsing or compiling happens. Once all parsing and compiling is done the brackets are replaced.

NOTE
Brackets are changed to 3 underscores [grid-name] => ___grid-name___ which works great but has a small chance of clashing with someones code, in this case I would suggest changing it to 4 underscores. Who is writing that many in their less/ css?

blizzardengle and others added 3 commits October 23, 2018 00:50
This adds a patch to lessc->compile that adds a protection to CSS named grids. Once all other parsing is done successfully the protection is removed and the compiled CSS returned.

The protection is a rough patch that removes brackets and replaces them with 3 underscores so [grid-name] becomes ___grid-name___ which does not trigger any parser errors allowing everything to be parsed as normal. If this patch is added into lessphp permanently I would suggest doing 4 underscores for (paranoia) safeties sake or a different pattern that is still safe to parse but less common to be used in someones code.
This is an additional patch to allow lessphp to compile CSS named grids from imported files.
This patch protects CSS named grids by replacing the brackets before
any parsing or compiling happens. Once all parsing and compiling is
done the brackets are replaced. NOTE: Brackets are changed to 3
underscores which works great but has a small chance of clashing
with someones code, in this case I would suggest changing it to 4
underscores. Who is writing that many in their less/ css?
@blizzardengle blizzardengle changed the title Issue 673 Fix Issue 673: Parse error with named CSS grid lines and areas Nov 10, 2018
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

Successfully merging this pull request may close these issues.

1 participant