summaryrefslogtreecommitdiff
path: root/src/library/text/mod.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-10-31 13:49:10 +0100
committerLaurenz <laurmaedje@gmail.com>2022-10-31 13:49:10 +0100
commit671ce3dedd40067bb5cea84fe0739de013827053 (patch)
treea4c990fc16b514f475dfceaa98d988e92ac6cf0c /src/library/text/mod.rs
parent636bdb9e438cfe4fb075a981e0512b9a3dde3e60 (diff)
Replace `encode` with `field`
Diffstat (limited to 'src/library/text/mod.rs')
-rw-r--r--src/library/text/mod.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/library/text/mod.rs b/src/library/text/mod.rs
index 2d302b9a..d7d2ee38 100644
--- a/src/library/text/mod.rs
+++ b/src/library/text/mod.rs
@@ -515,8 +515,11 @@ impl Show for StrongNode {
Self(self.0.unguard(sel)).pack()
}
- fn encode(&self, _: StyleChain) -> Dict {
- dict! { "body" => Value::Content(self.0.clone()) }
+ fn field(&self, name: &str) -> Option<Value> {
+ match name {
+ "body" => Some(Value::Content(self.0.clone())),
+ _ => None,
+ }
}
fn realize(&self, _: Tracked<dyn World>, _: StyleChain) -> SourceResult<Content> {
@@ -540,8 +543,11 @@ impl Show for EmphNode {
Self(self.0.unguard(sel)).pack()
}
- fn encode(&self, _: StyleChain) -> Dict {
- dict! { "body" => Value::Content(self.0.clone()) }
+ fn field(&self, name: &str) -> Option<Value> {
+ match name {
+ "body" => Some(Value::Content(self.0.clone())),
+ _ => None,
+ }
}
fn realize(&self, _: Tracked<dyn World>, _: StyleChain) -> SourceResult<Content> {