Only print headings with level <= 3 bold
Previously, all headings were printed with a bold font. With this change, we limit this to headings of level 1 to 3 to make the output more readable.
This commit is contained in:
parent
f4b0cba641
commit
f709a0d46d
@ -43,10 +43,15 @@ impl super::Printer for RichTextRenderer {
|
||||
}
|
||||
|
||||
fn print_heading(&self, level: usize, s: &str) -> io::Result<()> {
|
||||
write!(io::stdout(), "{}", termion::style::Bold)?;
|
||||
if level < 4 {
|
||||
write!(io::stdout(), "{}", termion::style::Bold)?;
|
||||
}
|
||||
let heading = format!("<h{level}>{text}</h{level}>", level = level, text = s);
|
||||
self.print_html(&heading)?;
|
||||
write!(io::stdout(), "{}", termion::style::Reset)
|
||||
if level < 4 {
|
||||
write!(io::stdout(), "{}", termion::style::Reset)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn println(&self) -> io::Result<()> {
|
||||
|
Loading…
Reference in New Issue
Block a user