Skip to content

Commit

Permalink
Updating .NET escaping of CSS selectors for the ID and name cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed May 26, 2018
1 parent cabfd91 commit 51376f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/Remote/RemoteWebDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ public void ResetInputState()
/// <returns>The selector with invalid characters escaped.</returns>
internal static string EscapeCssSelector(string selector)
{
string escaped = Regex.Replace(selector, @"(['""\\#.:;,!?+<>=~*^$|%&@`{}\-/\[\]\(\)])", @"\$1");
string escaped = Regex.Replace(selector, @"([ '""\\#.:;,!?+<>=~*^$|%&@`{}\-/\[\]\(\)])", @"\$1");
if (selector.Length > 0 && char.IsDigit(selector[0]))
{
escaped = @"\" + (30 + int.Parse(selector.Substring(0, 1), CultureInfo.InvariantCulture)).ToString(CultureInfo.InvariantCulture) + " " + selector.Substring(1);
Expand Down

0 comments on commit 51376f6

Please sign in to comment.