Clarify output format and remove redundant guidance.
New Features:
- Added explicit format and type list
Enhancements:
- Simplified instructions, removed unnecessary guidance
Bug Fixes:
- None
- New Features:
- Added `{{ context }}` variable to the commit message template to provide additional context.
- Enhancements:
- Removed the emoji usage line from the template to simplify the output.
```
- Simplify and clarify the structure of commit message generation guidelines.
- Replace "Format" with "Guidelines" for better readability.
- Remove redundant section numbering.
- Streamline emoji usage instruction into a single line.
- Clarify that the output should exclude labels like "Title:" or "Format:".
**Enhancements:**
- Improved template structure for better maintainability.
- More concise and direct instructions for users.
The `sanitize_ai_commit_message` function has been significantly improved to better handle AI-generated commit messages, including support for bolded headers, more robust header detection, and a fallback mechanism for non-conventional messages.
**Enhancements & Refinements:**
- Added comprehensive docstring explaining the function's purpose and behavior
- Improved regex pattern to match conventional commit headers with optional bolding (e.g., **feat: ...**)
- Added case-insensitive matching for commit types
- Implemented a state-based approach with `found_header` flag for clearer logic
- Added automatic removal of bold markers (**) from headers
- Introduced fallback behavior to return the first non-empty line if no conventional header is found
- Improved code structure with better variable naming and comments
- Added early return for empty input strings
**Bug Fixes:**
- Fixed potential issue where the function could return empty strings for non-conventional messages
- Resolved edge case handling for messages without proper headers
```