summaryrefslogtreecommitdiff
path: root/library/src/text/raw.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-03-10 20:47:23 +0100
committerLaurenz <laurmaedje@gmail.com>2023-03-10 21:19:50 +0100
commita9fdff244aef859449a76e5f762ee7c343a8ddcc (patch)
tree172b543183296b4bc30b3008650f594688467914 /library/src/text/raw.rs
parent62f35602a87574dcc607f1637aeae1be574981ff (diff)
Expose content representation more
Diffstat (limited to 'library/src/text/raw.rs')
-rw-r--r--library/src/text/raw.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/library/src/text/raw.rs b/library/src/text/raw.rs
index 3768e65e..72dd1782 100644
--- a/library/src/text/raw.rs
+++ b/library/src/text/raw.rs
@@ -104,19 +104,15 @@ pub struct RawNode {
}
impl Prepare for RawNode {
- fn prepare(
- &self,
- _: &mut Vt,
- mut this: Content,
- styles: StyleChain,
- ) -> SourceResult<Content> {
- this.push_field("lang", self.lang(styles).clone());
- Ok(this)
+ fn prepare(&self, _: &mut Vt, styles: StyleChain) -> SourceResult<Content> {
+ let mut node = self.clone().pack();
+ node.push_field("lang", self.lang(styles).clone());
+ Ok(node)
}
}
impl Show for RawNode {
- fn show(&self, _: &mut Vt, _: &Content, styles: StyleChain) -> SourceResult<Content> {
+ fn show(&self, _: &mut Vt, styles: StyleChain) -> SourceResult<Content> {
let text = self.text();
let lang = self.lang(styles).as_ref().map(|s| s.to_lowercase());
let foreground = THEME
@@ -279,7 +275,6 @@ pub static THEME: Lazy<synt::Theme> = Lazy::new(|| synt::Theme {
item("support.macro", Some("#16718d"), None),
item("meta.annotation", Some("#301414"), None),
item("entity.other, meta.interpolation", Some("#8b41b1"), None),
- item("invalid", Some("#ff0000"), None),
],
});