pub fn try_parse_setext_heading(
lines: &[&str],
pos: usize,
) -> Option<(usize, char)>Expand description
Try to parse a setext heading from lines, returns (level, underline_char) if found.
Setext headings consist of:
- A non-empty text line (heading content)
- An underline of
=(level 1) or-(level 2) characters
Rules:
- Underline must be at least 3 characters long
- Underline can have leading/trailing spaces (up to 3 leading spaces)
- All underline characters must be the same (
=or-) - Text line cannot be indented 4+ spaces (would be code block)
- Text line cannot be empty/blank