helpers

Shared helpers used across multiple CLI command implementations.

fn extract_heading

source

pub fn extract_heading(input: &str) -> Option<String>

Extract the text of the first markdown # heading from the input.

Returns None when no non-empty top-level heading is present. Lines with leading or trailing whitespace are trimmed before the # prefix check, so indented headings are still recognized.

Parameter Type Description
input &str the markdown text to search
returns Option<String> The heading text, trimmed.