Compare commits
No commits in common. "36d83c8c092e7984eaa03dbecc1083f49da13129" and "69c3f957051358eff961addbcae4ff02448513dc" have entirely different histories.
36d83c8c09
...
69c3f95705
@ -307,18 +307,18 @@ fn head_element(info: &DocumentInfo) -> HtmlElement {
|
||||
|
||||
/// Determine which kind of output the user generated.
|
||||
fn classify_output(mut output: Vec<HtmlNode>) -> SourceResult<OutputKind> {
|
||||
let count = output.iter().filter(|node| !matches!(node, HtmlNode::Tag(_))).count();
|
||||
let len = output.len();
|
||||
for node in &mut output {
|
||||
let HtmlNode::Element(elem) = node else { continue };
|
||||
let tag = elem.tag;
|
||||
let mut take = || std::mem::replace(elem, HtmlElement::new(tag::html));
|
||||
match (tag, count) {
|
||||
match (tag, len) {
|
||||
(tag::html, 1) => return Ok(OutputKind::Html(take())),
|
||||
(tag::body, 1) => return Ok(OutputKind::Body(take())),
|
||||
(tag::html | tag::body, _) => bail!(
|
||||
elem.span,
|
||||
"`{}` element must be the only element in the document",
|
||||
elem.tag,
|
||||
elem.tag
|
||||
),
|
||||
_ => {}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ pub fn layout_accent(
|
||||
|
||||
// Try to replace accent glyph with flattened variant.
|
||||
let flattened_base_height = scaled!(ctx, styles, flattened_accent_base_height);
|
||||
if base.ascent() > flattened_base_height {
|
||||
if base.height() > flattened_base_height {
|
||||
glyph.make_flattened_accent_form(ctx);
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ pub fn layout_accent(
|
||||
// minus the accent base height. Only if the base is very small, we need
|
||||
// a larger gap so that the accent doesn't move too low.
|
||||
let accent_base_height = scaled!(ctx, styles, accent_base_height);
|
||||
let gap = -accent.descent() - base.ascent().min(accent_base_height);
|
||||
let gap = -accent.descent() - base.height().min(accent_base_height);
|
||||
let size = Size::new(base.width(), accent.height() + gap + base.height());
|
||||
let accent_pos = Point::with_x(base_attach - accent_attach);
|
||||
let base_pos = Point::with_y(accent.height() + gap);
|
||||
|
@ -360,21 +360,6 @@ pub fn default_math_class(c: char) -> Option<MathClass> {
|
||||
// https://github.com/typst/typst/pull/5714
|
||||
'\u{22A5}' => Some(MathClass::Normal),
|
||||
|
||||
// Used as a binary connector in linear logic, where it is referred to
|
||||
// as "par".
|
||||
// https://github.com/typst/typst/issues/5764
|
||||
'⅋' => Some(MathClass::Binary),
|
||||
|
||||
// Those overrides should become the default in the next revision of
|
||||
// MathClass.txt.
|
||||
// https://github.com/typst/typst/issues/5764#issuecomment-2632435247
|
||||
'⎰' | '⟅' => Some(MathClass::Opening),
|
||||
'⎱' | '⟆' => Some(MathClass::Closing),
|
||||
|
||||
// Both ∨ and ⟑ are classified as Binary.
|
||||
// https://github.com/typst/typst/issues/5764
|
||||
'⟇' => Some(MathClass::Binary),
|
||||
|
||||
c => unicode_math_class::class(c),
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
@ -1,2 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html></html>
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 614 B |
Before Width: | Height: | Size: 327 B After Width: | Height: | Size: 327 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 284 B After Width: | Height: | Size: 284 B |
Before Width: | Height: | Size: 930 B After Width: | Height: | Size: 926 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@ -1,7 +0,0 @@
|
||||
--- html-elem-alone-context html ---
|
||||
#context html.elem("html")
|
||||
|
||||
--- html-elem-not-alone html ---
|
||||
// Error: 2-19 `<html>` element must be the only element in the document
|
||||
#html.elem("html")
|
||||
Text
|