Skip to content

Add unescapeString function for handling special character replacements #77

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

Merged
merged 1 commit into from
Nov 17, 2024

Conversation

catatsuy
Copy link
Owner

This pull request introduces a new utility function to unescape special characters in replacement strings and adds several test cases to ensure its functionality. The key changes include the addition of a new import, the implementation of the unescapeString function, its integration into the Run method, and the inclusion of new test cases.

Key Changes:

Code Enhancements:

  • internal/cli/cli.go: Added strings package to handle string replacements.
  • internal/cli/cli.go: Implemented unescapeString function to convert escaped sequences like \n, \t, and \r to their actual characters.
  • internal/cli/cli.go: Integrated unescapeString into the Run method to process replacement strings.

Testing:

  • internal/cli/cli_test.go: Added multiple test cases to verify the correct handling of special characters, including newlines, tabs, and carriage returns in replacement strings.

@catatsuy catatsuy merged commit 98cd1b6 into main Nov 17, 2024
5 checks passed
@catatsuy catatsuy deleted the feature-unescape-string-replacement branch November 17, 2024 05:52
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.

1 participant