Documents: inline formulas typeset in text; \( and \[ read as math
CI / site (push) Successful in 35s
CI / crate (push) Failing after 35s
CI / platforms (windows-latest) (push) Successful in 5m41s
CI / platforms (ubuntu-24.04) (push) Canceled after 0s

This commit is contained in:
ZacharyZhang-NY committed 2026-10-18 22:42:07 -04:00
1 parent 7d704d97f4
commit dceca9f3c6
12 files changed
+569 -61

No files matched your search

+5 -3
View File
@@ -318,12 +318,14 @@ impl<'a> Reader<'a> {
}
}
/// Text split at its images; lone `$$` math is block.
/// Text split at its images; lone `$$` or `\[` math is block.
fn paragraph(&self, node: &mdast::Node, children: &[mdast::Node], out: &mut Vec<Node>) {
if let [mdast::Node::InlineMath(math)] = children
&& self.source[span(node)].starts_with("$$")
&& ["$$", "\\["]
.iter()
.any(|open| self.source[span(node)].starts_with(open))
{
return out.push(Node::Math(math.value.clone()));
return out.push(Node::Math(math.value.trim().to_string()));
}
let mut run = Run {
table: matches!(node, mdast::Node::TableCell(_)),