Skip to content

fix(roadmap): find a job block below an HTML block #6791

Closed

Description

@dan-petty

Problem

CommonMark ends an HTML block of kind 6 or 7 only at a blank line. Kind 6 starts with a block tag such as </details> or <div>. Suppose that a person removes the blank line between such a line and a job block marker. Then the marker is part of that HTML block, and the marker rule of src/devops_cli/roadmap/body_hash.py does not take it as a marker. job_block_bounds and extract_section_and_outside find no job block. The next write of refine or alternatives then adds a second block, and the old block stays in the body as text of the person.

Evidence: a script on the code of origin/main (2026-11-22) reads a body that ends with a <details> part and the refine block:

blank line               bounds=(54, 133) section='\nSECTION\n'
</details> right above   bounds=None section=None
<div> right above        bounds=None section=None

The review of #6736 found this case. It is not in the scope of #6736, and the change of #6736 gives the same result as origin/main. On 2026-11-22, 0 of 836 open bodies have this form, so no item has the defect now. Each job writer puts a blank line before its block, so only an edit of a person makes this form.

Expected

A job block marker on a line of its own bounds the block also when an HTML block of kind 6 or 7 is directly above it. A write never leaves a second copy of the block of a job in the body.

Acceptance criteria

  • Test first: for a body with </details> and with <div>x</div> directly above the start marker, job_block_bounds and extract_section_and_outside find the block. The test fails on the base.
  • Test first: one refine write and one alternatives write on such a body leave one job block.

Dependencies

Alternatives check of 2026-11-23: in-use.
The repository already uses this tool.
Tool: executablebooks/markdown-it-py (https://github.com/executablebooks/markdown-it-py), MIT, last activity 2026-11-16, maintained.
Reason: Searches found markdown-it-py, a CommonMark parser that exposes HTML block kinds 6 and 7 with source line ranges; it supplies the boundary detection, but not the project's job and record marker rules or block extraction.

Covers:

  • CommonMark HTML block kinds 6 and 7 boundaries
  • Block tokens with source line ranges
  • Telling whether a marker line sits inside an HTML block

Lacks:

  • Job block marker rule and bounds extraction
  • Record block splitting and old-key preservation
  • Deliberate split when a marker directly follows an HTML block
  • Section extraction and body hash handling

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 22, 2026
  2. dan-petty commented on Nov 22, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 22, 2026
  4. dan-petty commented on Nov 23, 2026

    @dan-petty
    OwnerAuthor

    The review of #6785 found the same case for the record block. An HTML line of kind 6 or 7, such as <details> or <div>, directly above the record makes split_record read no record. The next write then adds a second record block, and the item loses the old keys. origin/main and the branch of #6785 behave the same, and no open body has this form on 2026-11-22.

    The fix of this issue should also read the record in that case, with the same marker rule.

  5. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (10)

    Tools considered:

    Searches run:

    • markdown-it-py html_block token map line range, results: 5
    • Python CommonMark compliant parser HTML block detection library, results: 5
    • markdown-it-py CommonMark parser Python library, results: 5
    • Python markdown parser that follows CommonMark spec HTML blocks, results: 5
    • mistune CommonMark HTML block parsing, results: 5
    • markdown-it-py, results: 5
    • markdown-it-py token map html_block documentation, results: 5
    • markdown-it-py parse tokens block level map line numbers, results: 5
    • "markdown-it-py" html_block token, results: 5
    • markdown-it-py readthedocs using tokens html_block, results: 5

    Sources:

  6. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 23, 2026
  7. removed
    status/in-review
    owner/agent
    on Nov 23, 2026
  8. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-23 04:17 UTC

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions