summaryrefslogtreecommitdiff
path: root/src/pretty.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/pretty.rs')
-rw-r--r--src/pretty.rs23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/pretty.rs b/src/pretty.rs
index 1281e27b..e2942f6f 100644
--- a/src/pretty.rs
+++ b/src/pretty.rs
@@ -97,13 +97,14 @@ impl Pretty for Node {
Self::Strong(_) => p.push('*'),
Self::Emph(_) => p.push('_'),
Self::Raw(raw) => raw.pretty(p),
- Self::Heading(heading) => heading.pretty(p),
- Self::List(list) => list.pretty(p),
- Self::Expr(expr) => {
- if expr.has_short_form() {
+ Self::Heading(n) => n.pretty(p),
+ Self::List(n) => n.pretty(p),
+ Self::Enum(n) => n.pretty(p),
+ Self::Expr(n) => {
+ if n.has_short_form() {
p.push('#');
}
- expr.pretty(p);
+ n.pretty(p);
}
}
}
@@ -175,13 +176,23 @@ impl Pretty for HeadingNode {
}
}
-impl Pretty for ListNode {
+impl Pretty for ListItem {
fn pretty(&self, p: &mut Printer) {
p.push_str("- ");
self.body.pretty(p);
}
}
+impl Pretty for EnumItem {
+ fn pretty(&self, p: &mut Printer) {
+ if let Some(number) = self.number {
+ write!(p, "{}", number).unwrap();
+ }
+ p.push_str(". ");
+ self.body.pretty(p);
+ }
+}
+
impl Pretty for Expr {
fn pretty(&self, p: &mut Printer) {
match self {