Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
blizzardengle wants to merge 3 commits into
leafo:master from
blizzardengle:issue-673
Open

Fix Issue 673: Parse error with named CSS grid lines and areas #643
blizzardengle wants to merge 3 commits into
leafo:master from
blizzardengle:issue-673

Conversation

@blizzardengle

@blizzardengle blizzardengle commented Oct 23, 2018

Copy link
Copy Markdown

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?

bovkun and blizzardengle reacted with thumbs up emoji
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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /