make headings contain links to themselves
This commit is contained in:
parent
6ae6076f0d
commit
5a0b46690e
1 changed files with 4 additions and 1 deletions
|
@ -311,6 +311,9 @@ impl<'a> Writer<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
match c {
|
match c {
|
||||||
|
Container::Heading { id, .. } => {
|
||||||
|
write!(out, r##"><a href="#{id}">"##)?;
|
||||||
|
}
|
||||||
Container::TableCell { alignment, .. }
|
Container::TableCell { alignment, .. }
|
||||||
if !matches!(alignment, Alignment::Unspecified) =>
|
if !matches!(alignment, Alignment::Unspecified) =>
|
||||||
{
|
{
|
||||||
|
@ -445,7 +448,7 @@ impl<'a> Writer<'a> {
|
||||||
}
|
}
|
||||||
out.push_str("</p>");
|
out.push_str("</p>");
|
||||||
}
|
}
|
||||||
Container::Heading { level, .. } => write!(out, "</h{level}>")?,
|
Container::Heading { level, .. } => write!(out, "</a></h{level}>")?,
|
||||||
Container::TableCell { head: false, .. } => out.push_str("</td>"),
|
Container::TableCell { head: false, .. } => out.push_str("</td>"),
|
||||||
Container::TableCell { head: true, .. } => out.push_str("</th>"),
|
Container::TableCell { head: true, .. } => out.push_str("</th>"),
|
||||||
Container::Caption => out.push_str("</caption>"),
|
Container::Caption => out.push_str("</caption>"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue