Skip to content

fix(#63): track fence delimiter type to prevent cross-delimiter closing - #64

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/63-cross-delimiter-fence-fix
Open

fix(#63): track fence delimiter type to prevent cross-delimiter closing#64
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/63-cross-delimiter-fence-fix

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

  • Replace boolean in_code_fence toggle with a fence_char variable that tracks which delimiter (` or ~) opened the current fence
  • A fence opened with backticks can now only be closed by backticks, and vice versa, conforming to CommonMark spec §4.5
  • Adds two new test cases covering both cross-delimiter directions (backtick→tilde and tilde→backtick)

Testing

  • python -m pytest tests/test_comment_parsing.py -x -q — all 43 tests pass
  • ruff check src/ tests/ and ruff format --check src/ tests/ — all clean
  • New tests verify that a mismatched delimiter inside a fence does not close it, and that the correct delimiter still closes it properly

Closes #63

Post-script verification

  • Branch is not main/master (agent/63-cross-delimiter-fence-fix)
  • Secret scan passed (gitleaks — 8c8934984757135bcf935e718a9972c24cb7e472..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

Replace the boolean `in_code_fence` toggle in `parse_update_instructions()`
with a `fence_char` variable that records which delimiter (`\`` or `~`)
opened the current fence. A fence opened with backticks can now only be
closed by backticks, and likewise for tildes, conforming to CommonMark
spec section 4.5.

Add two tests: one verifying that a tilde line inside a backtick fence
does not close it, and one verifying the reverse (backtick inside tilde
fence). All existing fence tests continue to pass.

Closes #63
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 16, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:23 PM UTC · Completed 12:35 PM UTC

Commit: 256d900 · View workflow run →

@fullsend-ai-review

Copy link
Copy Markdown

Looks good to me


Labels: Bug fix in Python comment parsing module (fence delimiter tracking)

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge bug Something isn't working python Pull requests that update python code labels Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working python Pull requests that update python code ready-for-merge All reviewers approved — ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parse_update_instructions fence toggle allows cross-delimiter closing

0 participants