feat: support line breaks

This commit is contained in:
PoiScript 2023-11-21 16:33:30 +08:00
parent 6598095a9f
commit 58dfb022c2
No known key found for this signature in database
GPG key ID: 22C2B1249D99985E
10 changed files with 199 additions and 60 deletions

View file

@ -510,4 +510,12 @@ impl Traverser for HtmlExport {
ctx.skip();
}
}
#[tracing::instrument(skip(self, ctx))]
fn line_break(&mut self, event: WalkEvent<&LineBreak>, ctx: &mut TraversalContext) {
if let WalkEvent::Enter(_) = event {
self.output += "<br/>";
ctx.skip();
}
}
}