Skip to content

Clarify JSON-escaped search-replace behavior#233

Open
yusufhay wants to merge 1 commit intowp-cli:mainfrom
yusufhay:docs/json-escaped-search-replace
Open

Clarify JSON-escaped search-replace behavior#233
yusufhay wants to merge 1 commit intowp-cli:mainfrom
yusufhay:docs/json-escaped-search-replace

Conversation

@yusufhay
Copy link
Copy Markdown

@yusufhay yusufhay commented May 6, 2026

Summary

  • Document that non-regex search-replace also handles JSON-escaped strings like http://example.com
  • Add a short example for replacing URLs in plain text and JSON-escaped data

Testing

  • php -l src/Search_Replace_Command.php
  • composer validate --no-check-publish
  • git diff --check

Closes #45

@yusufhay yusufhay requested a review from a team as a code owner May 6, 2026 22:53
@github-actions github-actions Bot added command:search-replace Related to 'search-replace' command scope:documentation Related to documentation labels May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Hello! 👋

Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project.

Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.

Here are some useful Composer commands to get you started:

  • composer install: Install dependencies.
  • composer test: Run the full test suite.
  • composer phpcs: Check for code style violations.
  • composer phpcbf: Automatically fix code style violations.
  • composer phpunit: Run unit tests.
  • composer behat: Run behavior-driven tests.

To run a single Behat test, you can use the following command:

# Run all tests in a single file
composer behat features/some-feature.feature

# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123

You can find a list of all available Behat steps in our handbook.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the documentation in README.md and src/Search_Replace_Command.php to clarify that the search-replace command handles JSON-escaped versions of search strings in non-regex mode. It also includes a new usage example for this functionality. I have no feedback to provide.

@yusufhay yusufhay force-pushed the docs/json-escaped-search-replace branch from 0652ae3 to 38fd251 Compare May 6, 2026 22:57
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:search-replace Related to 'search-replace' command scope:documentation Related to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better communicate failure to search-replace JSON-serialized URLs

1 participant