-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(css): parse css selectors with escape sequences #7689
Conversation
tns-core-modules/css/parser.ts
Outdated
@@ -743,7 +743,7 @@ export function parseSimpleIdentifierSelector(text: string, start: number = 0): | |||
} | |||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
test |
* 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)
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.