diff --git a/src/parser/markdown.rs b/src/parser/markdown.rs index 790572d..7fefa86 100644 --- a/src/parser/markdown.rs +++ b/src/parser/markdown.rs @@ -181,6 +181,21 @@ fn next_nonblank_indent(lines: &[Line<'_>], start: usize) -> Option { .map(|l| line_indent(l.text)) } +/// Next non-blank is a definition marker (`: ` / `~ `), including after +/// quote markers. pulldown keeps the DL open across one blank then +/// another `
`. +fn next_nonblank_is_dl_marker(lines: &[Line<'_>], start: usize) -> bool { + let Some(line) = lines[start..].iter().find(|l| !l.text.trim().is_empty()) else { + return false; + }; + if md_definition_list_marker_len(line.text).is_some() { + return true; + } + let depth = quote_marker_depth(line.text); + strip_quote_markers(line.text, depth) + .is_some_and(|inner| md_definition_list_marker_len(inner).is_some()) +} + fn starts_html_comment(line: &str) -> bool { // CM 4.6 type 2: at most three spaces. Four-space `