summaryrefslogtreecommitdiff
path: root/src/syntax
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-05-18 19:09:19 +0200
committerLaurenz <laurmaedje@gmail.com>2022-05-18 19:09:57 +0200
commit3965e10281ea3c8754a1877c9f7e71c1930bf4c3 (patch)
treee221b11692ac3af9f97c66625824e1c4e345c2eb /src/syntax
parent486f7b1bca15af3805ae1a8f63d72827f227a3d2 (diff)
Hack in ReX for now
Diffstat (limited to 'src/syntax')
-rw-r--r--src/syntax/ast.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs
index 95421213..0f575f31 100644
--- a/src/syntax/ast.rs
+++ b/src/syntax/ast.rs
@@ -5,7 +5,7 @@
use std::num::NonZeroUsize;
use std::ops::Deref;
-use super::{Green, GreenData, NodeKind, RedNode, RedRef, Span};
+use super::{Green, GreenData, NodeKind, RedNode, RedRef, Span, Spanned};
use crate::geom::{AngleUnit, LengthUnit};
use crate::util::EcoString;
@@ -77,7 +77,7 @@ impl Markup {
NodeKind::Strong => node.cast().map(MarkupNode::Strong),
NodeKind::Emph => node.cast().map(MarkupNode::Emph),
NodeKind::Raw(raw) => Some(MarkupNode::Raw(raw.as_ref().clone())),
- NodeKind::Math(math) => Some(MarkupNode::Math(math.as_ref().clone())),
+ NodeKind::Math(math) => Some(MarkupNode::Math(Spanned::new(math.as_ref().clone(), node.span()))),
NodeKind::Heading => node.cast().map(MarkupNode::Heading),
NodeKind::List => node.cast().map(MarkupNode::List),
NodeKind::Enum => node.cast().map(MarkupNode::Enum),
@@ -106,7 +106,7 @@ pub enum MarkupNode {
/// A raw block with optional syntax highlighting: `` `...` ``.
Raw(RawNode),
/// A math formula: `$a^2 = b^2 + c^2$`.
- Math(MathNode),
+ Math(Spanned<MathNode>),
/// A section heading: `= Introduction`.
Heading(HeadingNode),
/// An item in an unordered list: `- ...`.