Skip to content

fix(sleep): ignore fenced code in section_contains - #513

Open
Sylan1024 (ningsiyuan1024) wants to merge 2 commits into
microsoft:mainfrom
ningsiyuan1024:fix/sleep-section-contains-fences
Open

Sylan1024 (ningsiyuan1024) wants to merge 2 commits into
microsoft:mainfrom
ningsiyuan1024:fix/sleep-section-contains-fences

Conversation

@ningsiyuan1024

@ningsiyuan1024 Sylan1024 (ningsiyuan1024) commented Dec 4, 2026 •

Copy link
Copy Markdown

Why

section_contains gives a passing score when the only matching heading appears inside a fenced Markdown example.

What changed

  • Use markdown-it-py>=4.3.0 to find CommonMark fenced blocks and keep the existing literal heading matcher.
  • Cover backticks, tildes, and list boundaries, including a real heading after an unclosed fence in a list item.

Verification

  • The five fenced-code cases fail on the original judge and pass with this change.
  • The focused judge suite passed 140 tests and 10 subtests.
  • On Windows with Python 3.11 and CI's .[dev,parallel] dependencies, the full suite passed 2,547 tests. The same 25 tests failed on both this branch and main.
  • Ruff and git diff --check passed.

The human contributor is responsible for design and review. Codex handled execution.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant