From 148a06c070e6376e6f86b878d08dfd4f0aef8a73 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 24 Aug 2021 00:39:43 +0200 Subject: Switch from state to decorations for underline/strikethrough/overline --- src/eval/template.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/eval/template.rs') diff --git a/src/eval/template.rs b/src/eval/template.rs index 0ab49d04..4fc6985a 100644 --- a/src/eval/template.rs +++ b/src/eval/template.rs @@ -8,7 +8,8 @@ use super::{State, Str}; use crate::diag::StrResult; use crate::geom::{Align, Dir, Gen, GenAxis, Length, Linear, Sides, Size}; use crate::layout::{ - LayoutNode, LayoutTree, PadNode, PageRun, ParChild, ParNode, StackChild, StackNode, + Decoration, LayoutNode, LayoutTree, PadNode, PageRun, ParChild, ParNode, StackChild, + StackNode, }; use crate::util::EcoString; @@ -43,13 +44,6 @@ enum TemplateNode { Modify(Rc), } -/// A template node decoration. -#[derive(Debug, Clone, Eq, PartialEq, Hash)] -pub enum Decoration { - /// A link. - Link(EcoString), -} - impl Template { /// Create a new, empty template. pub fn new() -> Self { @@ -114,7 +108,7 @@ impl Template { self.make_mut().push(TemplateNode::Spacing(axis, spacing)); } - /// Add a decoration to the last template node. + /// Add a decoration to all contained nodes. pub fn decorate(&mut self, deco: Decoration) { for node in self.make_mut() { let decos = match node { -- cgit v1.2.3