Skip to content

Gfm - #65

Open
argonism wants to merge 2 commits into
mainfrom
gfm
Open

Gfm#65
argonism wants to merge 2 commits into
mainfrom
gfm

Conversation

@argonism

@argonism argonism commented Sep 7, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings September 7, 2025 23:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the MdHeader class to support indentation and validate header levels. The changes add parameter validation with warning messages for invalid header levels and introduce an optional indent parameter to control header positioning.

  • Added header level validation with warnings for levels outside the 1-6 range
  • Introduced an indent parameter to support header indentation
  • Updated documentation to reflect the new functionality

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
mdfy/elements/header.py Added header level validation, indent parameter support, and corresponding documentation updates
tests/elements/header_test.py Added test cases for invalid header level warnings and header indentation functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread mdfy/elements/header.py
Args:
content (str): The content of the header.
level (int, optional): The header level. Defaults to 1.
level (int, optional): The header level. Should be in a range of 6 >= level >= 1. Defaults to 1.

Copilot AI Sep 7, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The range description is unclear and uses unconventional notation. Consider rephrasing to 'The header level. Should be between 1 and 6 (inclusive). Defaults to 1.' for better clarity.

Suggested change
level (int, optional): The header level. Should be in a range of 6 >= level >= 1. Defaults to 1.
level (int, optional): The header level. Should be between 1 and 6 (inclusive). Defaults to 1.

Copilot uses AI. Check for mistakes.
Comment thread mdfy/elements/header.py
self.content = content
if level < 1 or level > 6:
warnings.warn(
f"Header level {level} is out of range"

Copilot AI Sep 7, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning message should specify the valid range for better user guidance. Consider changing to 'Header level {level} is out of range. Valid range is 1-6.'

Suggested change
f"Header level {level} is out of range"
f"Header level {level} is out of range. Valid range is 1-6."

Copilot uses AI. Check for mistakes.
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.

2 participants