feat: support subscript and superscript
This commit is contained in:
parent
58dfb022c2
commit
8b5c545d4b
12 changed files with 346 additions and 63 deletions
|
|
@ -518,4 +518,20 @@ impl Traverser for HtmlExport {
|
|||
ctx.skip();
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self, _ctx))]
|
||||
fn subscript(&mut self, event: WalkEvent<&Subscript>, _ctx: &mut TraversalContext) {
|
||||
match event {
|
||||
WalkEvent::Enter(_) => self.output += "<sub>",
|
||||
WalkEvent::Leave(_) => self.output += "</sub>",
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self, _ctx))]
|
||||
fn superscript(&mut self, event: WalkEvent<&Superscript>, _ctx: &mut TraversalContext) {
|
||||
match event {
|
||||
WalkEvent::Enter(_) => self.output += "<sup>",
|
||||
WalkEvent::Leave(_) => self.output += "</sup>",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue