Skip to content

Bug/Enhancement: Support any Heading Level (#, ##, ###) for Issue Title Parsing #32

Description

@replworks-bot

AI Generated • Published by @replworks-bot

Description

Currently, ai-issue throws a validation error or fails to parse the title if the first line of the markdown file uses ## or ### instead of a single #.

In some environments or LLM outputs, the markdown content is generated with a secondary (##) or tertiary (###) heading at the very top. The CLI tool should be flexible enough to recognize the very first heading line as the issue title, regardless of its heading level depth.

Proposed Solution

Update the markdown parser/validation logic so that it extracts the text from the first heading line found at the top of the file, supporting #, ##, and ###.

For example, all of the following should be successfully parsed as the title "Fix the bug":

  • # Fix the bug
  • ## Fix the bug
  • ### Fix the bug

Tasks

  • Modify the title extraction regex or parser logic to match #, ##, or ### on the first heading line.
  • Adjust the validation rule to prevent throwing errors when lower-level headings are used as the primary title.
  • Add test cases covering different heading levels at the start of a markdown file.

Additional Context

This change will make the tool much more resilient to varied markdown formats generated by different AI prompts or text editors.

Publisher: @replworks-bot

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions