pub fn extract_code_block(text: &str) -> Option<(Option<&str>, &str)>Expand description
Extract content from the first matching markdown code block.
Searches for ```lang and bare ``` fences.
Returns (language_hint, content) where hint is None for bare fences.
ยงExamples
use llm_output_parser::extract::extract_code_block;
let input = "Here:\n```json\n{\"a\": 1}\n```";
let (lang, content) = extract_code_block(input).unwrap();
assert_eq!(lang, Some("json"));
assert_eq!(content, "{\"a\": 1}");