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

issue_1356_1376_1388: Fixed escaping for copying #1389

Merged
merged 5 commits into from
Jul 20, 2023
Merged

Conversation

arslanbekova
Copy link
Member

@arslanbekova arslanbekova commented Jul 18, 2023

  • Removed replacement " with ' in css locators, added escaping instead (1356)
  • Fixed editing locator (1376)
  • Fixed copy option for xPath (1388)

@arslanbekova arslanbekova changed the title fixed escaping for copy option issue_1356_1376_1388: Fixed escaping while copying Jul 19, 2023
@arslanbekova arslanbekova marked this pull request as ready for review July 19, 2023 07:20
transformedText = beforeFirstDoubleQuote + insideOfDoubleQuotes + afterLastDoubleQuote;
}

return transformedText;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, create unit tests for this function

.replace(/=\\'\\3/g, "=\\'\\\\3") // two different cases for \\3 to avoid affecting something else...
.replace(/\\/g, "\\\\")
.replace(/"/g, '\\"');
const transformedText = escapeLocator(text);
chrome.devtools.inspectedWindow.eval(`copy('${transformedText}')`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please, create a new module for these two functions. They are more than just helpers from now

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@arslanbekova arslanbekova changed the title issue_1356_1376_1388: Fixed escaping while copying issue_1356_1376_1388: Fixed escaping for copying Jul 19, 2023
Copy link
Contributor

@MariiaNebesnova MariiaNebesnova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! Thank you!

@arslanbekova arslanbekova merged commit b30a9c3 into master Jul 20, 2023
2 checks passed
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.

3 participants