Skip to main content

parse_version_heading

Function parse_version_heading 

Source
fn parse_version_heading(line: &str) -> Option<String>
Expand description

Parses an ##-level Markdown heading and returns the version string, or None if the heading does not look like a version entry.

Recognised formats:

  • ## [1.2.0] - 2024-01-15 (Keep a Changelog bracketed)
  • ## [1.2.0] (bracketed, no date)
  • ## 1.2.0 - 2024-01-15 (unbracketed with date)
  • ## 1.2.0 (unbracketed, no date)

A leading v prefix is silently stripped from the version string so that ## [v1.2.0] produces "1.2.0", matching the convention used by version extractors with tag_prefix = "v".