Skip to content

fix: anchor code fences to avoid splitting on nested backticks - #604

Open
mohmedmm wants to merge 9 commits into
google:mainfrom
mohmedmm:fix-fenced-json-backticks
Open

mohmedmm wants to merge 9 commits into
google:mainfrom
mohmedmm:fix-fenced-json-backticks

Conversation

@mohmedmm

@mohmedmm mohmedmm commented Nov 2, 2026

Copy link
Copy Markdown

Description

Unanchored code fence regex matched backticks inside json string literals, causing parse_output to detect false multiple fences. Anchored opening and closing delimiters to line starts and matched closing fence length to opening fence per CommonMark.

Fixes #581

Bug fix

How Has This Been Tested?

Ran pytest regression test suite:
$ python -m pytest tests/format_handler_test.py tests/resolver_test.py
\

Checklist:

  • I have read and acknowledged Google's Open Source Code of conduct.
  • I have read the Contributing page, and I either signed the Google Individual CLA or am covered by my company's Corporate CLA.
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach.
  • I have made any needed documentation changes, or noted in the linked issue(s) that documentation elsewhere needs updating.
  • I have added tests, or I have ensured existing tests cover the changes
  • I have followed Google's Python Style Guide and ran \pylint\ over the affected code.

@github-actions github-actions Bot added the size/XS Pull request with less than 50 lines changed label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

⚠️ Branch Update Required

Your branch is 1 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

@github-actions github-actions Bot added size/S Pull request with 50-150 lines changed and removed size/XS Pull request with less than 50 lines changed labels Nov 9, 2026
@aksg87
aksg87 force-pushed the fix-fenced-json-backticks branch from 17158e6 to 3e5d5c8 Compare November 9, 2026 06:52
@github-actions github-actions Bot added size/M Pull request with 150-600 lines changed and removed size/S Pull request with 50-150 lines changed labels Nov 9, 2026
@aksg87
aksg87 force-pushed the fix-fenced-json-backticks branch from 3e5d5c8 to 7ce0bd0 Compare November 9, 2026 07:41
@github-actions

Copy link
Copy Markdown

⚠️ Branch Update Required

Your branch is 1 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

@github-actions

Copy link
Copy Markdown

⚠️ Branch Update Required

Your branch is 1 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

@github-actions

Copy link
Copy Markdown

⚠️ Branch Update Required

Your branch is 10 commits behind main. Please update your branch to ensure CI checks run with the latest code:

git fetch origin main
git merge origin/main
git push

Note: Enable "Allow edits by maintainers" to allow automatic updates.

This branch has not been deployed

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

Labels

size/M Pull request with 150-600 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: fenced JSON parsing rejects triple backticks inside extraction strings

2 participants