fix(css): parse css selectors with escape sequences#7689
Merged
manoldonev merged 3 commits intoNativeScript:masterfrom Aug 26, 2019
rigor789:fix-7688
Merged
fix(css): parse css selectors with escape sequences#7689manoldonev merged 3 commits intoNativeScript:masterfrom rigor789:fix-7688
manoldonev merged 3 commits intoNativeScript:masterfrom
rigor789:fix-7688
Conversation
NathanaelA
reviewed
Aug 17, 2019
tns-core-modules/css/parser.ts
Outdated
| const end = simpleIdentifierSelectorRegEx.lastIndex; | ||
| const type = <"#" | "." | ":" | "">result[1]; | ||
| const identifier: string = result[2]; | ||
| const identifier: string = result[2].replace(/\\/g, ''); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Member
Author
There was a problem hiding this comment.
@NathanaelA Unfortunately not!
For example, if the input is
.w-6\/12 {
width: 50%
}The parser receives both the \ backslash and the / forward slash. If the regex doesn't match the \ anything after it gets ignored, including the /12 part, so we actually need to allow it, but later remove it, since it is just an escape character.
I don't think it's possible to capture a group with skipping characters in the middle.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Contributor
|
test |
manoldonev
approved these changes
Aug 26, 2019
manoldonev
pushed a commit
that referenced
this pull request
Aug 26, 2019
manoldonev
added a commit
that referenced
this pull request
Aug 29, 2019
manoldonev
added a commit
that referenced
this pull request
Sep 12, 2019
* feat(android): fix tab resource icon size based on spec (#7737) * feat(ios): add icon rendering mode for bottom navigation (#7738) * fix(ios-tabs): crash when add tabstrip in loaded event (#7743) * fix(css): parse css selectors with escape sequences (#7689) (#7732) * fix(ios-tabs): handle nesting proxy view container (#7755) * fix-next(css): className to preserve root views classes (#7725) * docs: cut the 6.1.0 release (#7773) * fix(android-list-picker): NoSuchFieldException on api29 (#7790) * chore: hardcode tslib version to 1.10.0 (#7776) * fix(css-calc): reduce_css_calc_1.default is not a function (#7787) (#7801)
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
What is the current behavior?
#7688
What is the new behavior?
With the changes, the escaped css selectors are parsed correctly and can be applied to elements.
Fixes/Implements/Closes #7688.