Skip to content

fix(wizard): properly parse markdown lists for CVE Notes#198

Merged
jdstrand merged 1 commit into
mainfrom
jdstrand/fix-md-lists
Jun 1, 2026
Merged

fix(wizard): properly parse markdown lists for CVE Notes#198
jdstrand merged 1 commit into
mainfrom
jdstrand/fix-md-lists

Conversation

@jdstrand

@jdstrand jdstrand commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

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 updates the CVE add wizard’s Notes formatting so that Markdown-style unordered list items (* / -) are preserved as list items (with proper indentation and wrapping) instead of being folded into surrounding paragraph text.

Changes:

  • Add _asListItem() helper to detect * / - list items and extract marker + content.
  • Refactor _formatAsNoteText() to parse paragraphs into text vs list-item segments and render list items with a hanging indent.
  • Add comprehensive unit tests covering list detection, mixed markers, lists at the start of a note, lists between paragraphs, and wrapping behavior.

Reviewed changes

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

File Description
cvelib/wizard.py Implements list-item detection and updates note formatting to preserve list structure.
tests/test_wizard.py Adds test coverage for list parsing/formatting scenarios and wrapping expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cvelib/wizard.py Outdated
for cont_line in continuation_wrapped:
result_lines.append(f"{continuation_prefix}{cont_line}")
if not wrapped:
# Marker with no content, eg a bare "*"
@jdstrand jdstrand force-pushed the jdstrand/fix-md-lists branch from e0d1d51 to 0dd5726 Compare June 1, 2026 13:42
@jdstrand jdstrand merged commit 1bc9c16 into main Jun 1, 2026
8 checks passed
@jdstrand jdstrand deleted the jdstrand/fix-md-lists branch June 1, 2026 13:47
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