feat: handle <thead> in html export
This commit is contained in:
parent
1362624083
commit
db7fb70724
5 changed files with 300 additions and 14 deletions
|
|
@ -30,12 +30,15 @@ impl Traverser for MyHtmlHandler {
|
|||
let level = title.headline().and_then(|h| h.level()).unwrap_or(1);
|
||||
let level = min(level, 6);
|
||||
let raw = title.syntax().to_string();
|
||||
self.0.output += &format!("<h{level}><a id=\"{0}\" href=\"#{0}\">", slugify!(&raw));
|
||||
self.0.push_str(format!(
|
||||
"<h{level}><a id=\"{0}\" href=\"#{0}\">",
|
||||
slugify!(&raw)
|
||||
));
|
||||
}
|
||||
WalkEvent::Leave(title) => {
|
||||
let level = title.headline().and_then(|h| h.level()).unwrap_or(1);
|
||||
let level = min(level, 6);
|
||||
self.0.output += &format!("</a></h{level}>");
|
||||
self.0.push_str(format!("</a></h{level}>"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue