Skip to content

Correct the docs on JSON-encoded URLs - #251

Merged
schlessera merged 1 commit into
mainfrom
docs/json-escaped-urls-auto
Oct 30, 2026
Merged

schlessera merged 1 commit into
mainfrom
docs/json-escaped-urls-auto

Conversation

@schlessera

@schlessera schlessera commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

#248 documented that a plain search/replace won't match URLs whose slashes are escaped in JSON (https:\/\/example.com), and told users to run a second pass with escaped slashes.

That hasn't been true since #213, which shipped in v3.0.0. It replaces the JSON-encoded form of the search string automatically, in both SQL and PHP mode. #248 then went out in v3.0.2, so the current release has the wrong advice.

This PR:

  • replaces the note with a description of the automatic handling;
  • documents the one remaining gap: --regex gets no JSON handling, so a regex pattern has to account for escaped slashes itself;
  • removes the example with escaped slashes, which no longer does anything.

Thanks to @pwtyler for spotting this in #248 (comment).

Summary by CodeRabbit

  • Documentation
    • Clarified that standard searches also match JSON-escaped search strings, while regex patterns must account for escaped slashes.
    • Removed the example that used a separate search-and-replace for escaped URLs.

Since #213, search-replace also replaces the JSON-encoded form of the
search string, so the extra run with escaped slashes added in #248 is
not needed. Document the automatic handling instead, and note that it
does not apply with --regex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 91724e2b-344e-4564-be9b-cd5c402cb98d
Commits

Reviewing files that changed from the base of the PR and between 54d3e08 and 4ec8b89.

Files selected for processing: 2
  • README.md
  • src/Search_Replace_Command.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The README and command documentation now describe JSON-encoded search matching for ordinary searches and explain that regex patterns must account for escaped slashes. Both remove the separate escaped-URL search example.

Changes: Search guidance

Layer / File(s) Summary
Document JSON-encoded search behavior
README.md, src/Search_Replace_Command.php
The documentation describes matching the JSON-encoded search string for ordinary searches. It states that regex patterns must handle escaped slashes and removes the separate escaped-URL example.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Possibly related PRs

Suggested reviewers: rejaulalomkhan

Merge Risk: Minimal · up to 4ec8b

No actionable merge risk remains; the documentation correction is ready to merge.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Correct the docs on JSON-encoded URLs" matches the main change. The PR updates the README and command documentation to say that non-regex search-replace already handles the JSON-encoded for…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Correct the docs on JSON-encoded URLs" matches the main change. The PR updates the README and command documentation to say that non-regex search-replace already handles the JSON-encoded form of the search string, that --regex does not get this handling, and that the escaped-slash example was removed. The title is short, specific, and matches the stated objectives of PR #251.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added command:search-replace Related to 'search-replace' command scope:documentation Related to documentation labels Oct 30, 2026
@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@schlessera
schlessera merged commit 1e74a46 into main Oct 30, 2026
58 checks passed
@schlessera
schlessera deleted the docs/json-escaped-urls-auto branch October 30, 2026 19:25
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.

1 participant