summaryrefslogtreecommitdiff
path: root/src/library/text
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/text')
-rw-r--r--src/library/text/deco.rs2
-rw-r--r--src/library/text/link.rs2
-rw-r--r--src/library/text/mod.rs4
-rw-r--r--src/library/text/raw.rs10
4 files changed, 11 insertions, 7 deletions
diff --git a/src/library/text/deco.rs b/src/library/text/deco.rs
index 34c70720..dedaa6e8 100644
--- a/src/library/text/deco.rs
+++ b/src/library/text/deco.rs
@@ -45,7 +45,7 @@ impl<const L: DecoLine> Show for DecoNode<L> {
Self(self.0.unguard(sel)).pack()
}
- fn encode(&self) -> Dict {
+ fn encode(&self, _: StyleChain) -> Dict {
dict! { "body" => Value::Content(self.0.clone()) }
}
diff --git a/src/library/text/link.rs b/src/library/text/link.rs
index 9e933529..284f0b1f 100644
--- a/src/library/text/link.rs
+++ b/src/library/text/link.rs
@@ -36,7 +36,7 @@ impl Show for LinkNode {
.pack()
}
- fn encode(&self) -> Dict {
+ fn encode(&self, _: StyleChain) -> Dict {
dict! {
"url" => Value::Str(self.url.clone()),
"body" => match &self.body {
diff --git a/src/library/text/mod.rs b/src/library/text/mod.rs
index 80b036ac..ae7024e5 100644
--- a/src/library/text/mod.rs
+++ b/src/library/text/mod.rs
@@ -524,7 +524,7 @@ impl Show for StrongNode {
Self(self.0.unguard(sel)).pack()
}
- fn encode(&self) -> Dict {
+ fn encode(&self, _: StyleChain) -> Dict {
dict! { "body" => Value::Content(self.0.clone()) }
}
@@ -549,7 +549,7 @@ impl Show for EmphNode {
Self(self.0.unguard(sel)).pack()
}
- fn encode(&self) -> Dict {
+ fn encode(&self, _: StyleChain) -> Dict {
dict! { "body" => Value::Content(self.0.clone()) }
}
diff --git a/src/library/text/raw.rs b/src/library/text/raw.rs
index 6124359e..52cabe3d 100644
--- a/src/library/text/raw.rs
+++ b/src/library/text/raw.rs
@@ -52,10 +52,14 @@ impl Show for RawNode {
Self { text: self.text.clone(), ..*self }.pack()
}
- fn encode(&self) -> Dict {
+ fn encode(&self, styles: StyleChain) -> Dict {
dict! {
- "text" => Value::Str(self.text.clone()),
- "block" => Value::Bool(self.block)
+ "text" => Value::Str(self.text.clone()),
+ "block" => Value::Bool(self.block),
+ "lang" => match styles.get(Self::LANG) {
+ Some(lang) => Value::Str(lang.clone()),
+ None => Value::None,
+ },
}
}