summaryrefslogtreecommitdiff
path: root/src/library/structure
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/structure')
-rw-r--r--src/library/structure/heading.rs4
-rw-r--r--src/library/structure/list.rs13
-rw-r--r--src/library/structure/table.rs9
3 files changed, 25 insertions, 1 deletions
diff --git a/src/library/structure/heading.rs b/src/library/structure/heading.rs
index 4f6c54f3..468757ad 100644
--- a/src/library/structure/heading.rs
+++ b/src/library/structure/heading.rs
@@ -64,6 +64,10 @@ impl HeadingNode {
}
impl Show for HeadingNode {
+ fn unguard(&self, sel: Selector) -> ShowNode {
+ Self { body: self.body.unguard(sel), ..*self }.pack()
+ }
+
fn encode(&self) -> Dict {
dict! {
"level" => Value::Int(self.level.get() as i64),
diff --git a/src/library/structure/list.rs b/src/library/structure/list.rs
index 4356ffb4..fca7d5ce 100644
--- a/src/library/structure/list.rs
+++ b/src/library/structure/list.rs
@@ -75,6 +75,17 @@ impl<const L: ListKind> ListNode<L> {
}
impl<const L: ListKind> Show for ListNode<L> {
+ fn unguard(&self, sel: Selector) -> ShowNode {
+ Self {
+ items: self.items.map(|item| ListItem {
+ body: Box::new(item.body.unguard(sel)),
+ ..*item
+ }),
+ ..*self
+ }
+ .pack()
+ }
+
fn encode(&self) -> Dict {
dict! {
"start" => Value::Int(self.start as i64),
@@ -83,7 +94,7 @@ impl<const L: ListKind> Show for ListNode<L> {
"items" => Value::Array(
self.items
.items()
- .map(|item| Value::Content((*item.body).clone()))
+ .map(|item| Value::Content(item.body.as_ref().clone()))
.collect()
),
}
diff --git a/src/library/structure/table.rs b/src/library/structure/table.rs
index 7b3f2ac5..304a8681 100644
--- a/src/library/structure/table.rs
+++ b/src/library/structure/table.rs
@@ -51,6 +51,15 @@ impl TableNode {
}
impl Show for TableNode {
+ fn unguard(&self, sel: Selector) -> ShowNode {
+ Self {
+ tracks: self.tracks.clone(),
+ gutter: self.gutter.clone(),
+ cells: self.cells.iter().map(|cell| cell.unguard(sel)).collect(),
+ }
+ .pack()
+ }
+
fn encode(&self) -> Dict {
dict! {
"cells" => Value::Array(