use std::{ io::{self, Read as _}, process, }; use ariadne::{Color, Label, Report, ReportKind, Source}; use pulldown_cmark::{Options, Tag}; use pulldown_cmark_ast::{Ast, Group, Span, Spanned, Tree}; fn main() { let mut txt = String::new(); eprintln!("reading from stdin..."); if let Err(e) = io::stdin().read_to_string(&mut txt) { eprintln!("Error reading from stdin: {}", e); process::exit(1) }; let ast = pulldown_cmark_ast::Ast::new_ext(&txt, Options::all()); let mut labels = vec![]; visit_ast(&mut labels, &ast); Report::build(ReportKind::Custom("info", Color::Blue), (), 0) .with_labels(labels) .finish() .print(Source::from(txt)) .unwrap(); } fn visit_ast(labels: &mut Vec