summaryrefslogtreecommitdiff
path: root/src/library/text/raw.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-10-31 15:47:49 +0100
committerLaurenz <laurmaedje@gmail.com>2022-10-31 15:47:49 +0100
commitf547c97072881069417acd3b79b08fb7ecf40ba2 (patch)
tree9d860b14be6bb4fae746e48f3dbdab00b28f6625 /src/library/text/raw.rs
parent671ce3dedd40067bb5cea84fe0739de013827053 (diff)
Reduce usage of `finalize`
Diffstat (limited to 'src/library/text/raw.rs')
-rw-r--r--src/library/text/raw.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/library/text/raw.rs b/src/library/text/raw.rs
index 6d19deff..85e8133c 100644
--- a/src/library/text/raw.rs
+++ b/src/library/text/raw.rs
@@ -105,7 +105,12 @@ impl Show for RawNode {
realized = Content::block(realized);
}
- Ok(realized)
+ let mut map = StyleMap::new();
+ map.set(TextNode::OVERHANG, false);
+ map.set(TextNode::HYPHENATE, Smart::Custom(Hyphenate(false)));
+ map.set(TextNode::SMART_QUOTES, false);
+
+ Ok(realized.styled_with_map(map))
}
fn finalize(
@@ -116,9 +121,6 @@ impl Show for RawNode {
) -> SourceResult<Content> {
let mut map = StyleMap::new();
map.set_family(styles.get(Self::FAMILY).clone(), styles);
- map.set(TextNode::OVERHANG, false);
- map.set(TextNode::HYPHENATE, Smart::Custom(Hyphenate(false)));
- map.set(TextNode::SMART_QUOTES, false);
if self.block {
realized = realized.spaced(styles.get(Self::ABOVE), styles.get(Self::BELOW));