Skip to content

Conversation

@Shuklax
Copy link

@Shuklax Shuklax commented Dec 25, 2025

What kind of change does this PR introduce?
Bugfix / Refactoring.

Issue Number:
Closes #2013

Summary:
This PR provides a robust, performance-optimized fix for the JSON string parsing issue where trailing escaped backslashes (e.g., "\\") break the editor's syntax highlighting.

Technical Advantage over other proposals:
Unlike solutions using manual character-counting loops, this PR implements a parity-aware regex lookbehind: (?<=(^|[^])(?:\)*)".

Efficiency:
It leverages the native V8/C++ regex engine, which is more performant than manual JavaScript loops for large payloads.

Maintainability:
It solves the problem at the regex definition level, keeping the core parsing logic clean and declarative.

Improved Coverage:
It also updates regexString to ensure that full-string matches are correctly identified when they contain escaped backslashes.

@Shuklax Shuklax requested a review from a team as a code owner December 25, 2025 13:17
@github-project-automation github-project-automation bot moved this to Ready to review in PR - Triage Group Dec 25, 2025
@github-actions
Copy link

github-actions bot commented Dec 25, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
website ✅ Ready (View Log) Visit Preview 6306a03

@codecov
Copy link

codecov bot commented Dec 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (58506bc) to head (6306a03).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2030   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           30        30           
  Lines          633       633           
  Branches       196       196           
=========================================
  Hits           633       633           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

Status: Ready to review

Development

Successfully merging this pull request may close these issues.

🐛 Bug: Custom JSON parser fails on escaped backslashes preceding quotes

1 participant