diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-02-02 14:13:05 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-02-02 14:13:05 +0100 |
| commit | 21dd99926a24d7cc69bf6b032d1107c78a04a5cf (patch) | |
| tree | ba67950a6f266edf3e3c2924859eb6af0110330c /library | |
| parent | aa0f03fe0461a009b372d4868ea96f85b8bafe62 (diff) | |
Allow arbitrary math directly in content
Diffstat (limited to 'library')
| -rw-r--r-- | library/src/layout/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/library/src/layout/mod.rs b/library/src/layout/mod.rs index 330db716..d3a9370b 100644 --- a/library/src/layout/mod.rs +++ b/library/src/layout/mod.rs @@ -41,6 +41,7 @@ use typst::model::{ }; use crate::basics::{EnumNode, ListNode, TermItem, TermsNode}; +use crate::math::{FormulaNode, LayoutMath}; use crate::meta::DocumentNode; use crate::prelude::*; use crate::shared::BehavedBuilder; @@ -555,12 +556,19 @@ impl<'a> ParBuilder<'a> { || content.is::<HNode>() || content.is::<SmartQuoteNode>() || content.is::<TextNode>() + || content.is::<FormulaNode>() || content.has::<dyn Inline>() { self.0.push(content.clone(), styles); return true; } + if content.has::<dyn LayoutMath>() { + let formula = FormulaNode { body: content.clone(), block: false }.pack(); + self.0.push(formula, styles); + return true; + } + false } |
