diff --git a/Cargo.lock b/Cargo.lock index ab2d2cc83..4b70e06bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1259,6 +1259,12 @@ dependencies = [ "serde", ] +[[package]] +name = "infer" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a588916bfdfd92e71cacef98a63d9b1f0d74d6599980d11894290e7ddefffcf7" + [[package]] name = "inotify" version = "0.11.0" @@ -3127,6 +3133,7 @@ dependencies = [ "comemo", "ecow", "image", + "infer", "krilla", "krilla-svg", "serde", diff --git a/Cargo.toml b/Cargo.toml index 12870b809..bc563b980 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,6 +71,7 @@ icu_segmenter = { version = "1.4", features = ["serde"] } if_chain = "1" image = { version = "0.25.5", default-features = false, features = ["png", "jpeg", "gif"] } indexmap = { version = "2", features = ["serde"] } +infer = { version = "0.19.0", default-features = false } kamadak-exif = "0.6" krilla = { version = "0.4.0", default-features = false, features = ["raster-images", "comemo", "rayon"] } krilla-svg = "0.1.0" diff --git a/crates/typst-layout/src/inline/linebreak.rs b/crates/typst-layout/src/inline/linebreak.rs index 31512604f..ada048c7d 100644 --- a/crates/typst-layout/src/inline/linebreak.rs +++ b/crates/typst-layout/src/inline/linebreak.rs @@ -690,13 +690,34 @@ fn breakpoints(p: &Preparation, mut f: impl FnMut(usize, Breakpoint)) { let breakpoint = if point == text.len() { Breakpoint::Mandatory } else { + const OBJ_REPLACE: char = '\u{FFFC}'; match lb.get(c) { - // Fix for: https://github.com/unicode-org/icu4x/issues/4146 - LineBreak::Glue | LineBreak::WordJoiner | LineBreak::ZWJ => continue, LineBreak::MandatoryBreak | LineBreak::CarriageReturn | LineBreak::LineFeed | LineBreak::NextLine => Breakpoint::Mandatory, + + // https://github.com/typst/typst/issues/5489 + // + // OBJECT-REPLACEMENT-CHARACTERs provide Contingent Break + // opportunities before and after by default. This behaviour + // is however tailorable, see: + // https://www.unicode.org/reports/tr14/#CB + // https://www.unicode.org/reports/tr14/#TailorableBreakingRules + // https://www.unicode.org/reports/tr14/#LB20 + // + // Don't provide a line breaking opportunity between a LTR- + // ISOLATE (or any other Combining Mark) and an OBJECT- + // REPLACEMENT-CHARACTER representing an inline item, if the + // LTR-ISOLATE could end up as the only character on the + // previous line. + LineBreak::CombiningMark + if text[point..].starts_with(OBJ_REPLACE) + && last + c.len_utf8() == point => + { + continue; + } + _ => Breakpoint::Normal, } }; diff --git a/crates/typst-layout/src/inline/shaping.rs b/crates/typst-layout/src/inline/shaping.rs index 8236d1e36..ca723c0a5 100644 --- a/crates/typst-layout/src/inline/shaping.rs +++ b/crates/typst-layout/src/inline/shaping.rs @@ -20,7 +20,7 @@ use unicode_bidi::{BidiInfo, Level as BidiLevel}; use unicode_script::{Script, UnicodeScript}; use super::{decorate, Item, Range, SpanMapper}; -use crate::modifiers::{FrameModifiers, FrameModify}; +use crate::modifiers::FrameModifyText; /// The result of shaping text. /// @@ -327,7 +327,7 @@ impl<'a> ShapedText<'a> { offset += width; } - frame.modify(&FrameModifiers::get_in(self.styles)); + frame.modify_text(self.styles); frame } diff --git a/crates/typst-layout/src/modifiers.rs b/crates/typst-layout/src/modifiers.rs index ac5f40b04..b0371d63e 100644 --- a/crates/typst-layout/src/modifiers.rs +++ b/crates/typst-layout/src/modifiers.rs @@ -1,6 +1,6 @@ use typst_library::foundations::StyleChain; -use typst_library::layout::{Fragment, Frame, FrameItem, HideElem, Point}; -use typst_library::model::{Destination, LinkElem}; +use typst_library::layout::{Abs, Fragment, Frame, FrameItem, HideElem, Point, Sides}; +use typst_library::model::{Destination, LinkElem, ParElem}; /// Frame-level modifications resulting from styles that do not impose any /// layout structure. @@ -52,14 +52,7 @@ pub trait FrameModify { impl FrameModify for Frame { fn modify(&mut self, modifiers: &FrameModifiers) { - if let Some(dest) = &modifiers.dest { - let size = self.size(); - self.push(Point::zero(), FrameItem::Link(dest.clone(), size)); - } - - if modifiers.hidden { - self.hide(); - } + modify_frame(self, modifiers, None); } } @@ -82,6 +75,41 @@ where } } +pub trait FrameModifyText { + /// Resolve and apply [`FrameModifiers`] for this text frame. + fn modify_text(&mut self, styles: StyleChain); +} + +impl FrameModifyText for Frame { + fn modify_text(&mut self, styles: StyleChain) { + let modifiers = FrameModifiers::get_in(styles); + let expand_y = 0.5 * ParElem::leading_in(styles); + let outset = Sides::new(Abs::zero(), expand_y, Abs::zero(), expand_y); + modify_frame(self, &modifiers, Some(outset)); + } +} + +fn modify_frame( + frame: &mut Frame, + modifiers: &FrameModifiers, + link_box_outset: Option>, +) { + if let Some(dest) = &modifiers.dest { + let mut pos = Point::zero(); + let mut size = frame.size(); + if let Some(outset) = link_box_outset { + pos.y -= outset.top; + pos.x -= outset.left; + size += outset.sum_by_axis(); + } + frame.push(pos, FrameItem::Link(dest.clone(), size)); + } + + if modifiers.hidden { + frame.hide(); + } +} + /// Performs layout and modification in one step. /// /// This just runs `layout(styles).modified(&FrameModifiers::get_in(styles))`, diff --git a/crates/typst-pdf/Cargo.toml b/crates/typst-pdf/Cargo.toml index f6f08b5bc..5745d0530 100644 --- a/crates/typst-pdf/Cargo.toml +++ b/crates/typst-pdf/Cargo.toml @@ -23,6 +23,7 @@ bytemuck = { workspace = true } comemo = { workspace = true } ecow = { workspace = true } image = { workspace = true } +infer = { workspace = true } krilla = { workspace = true } krilla-svg = { workspace = true } serde = { workspace = true } diff --git a/crates/typst-pdf/src/embed.rs b/crates/typst-pdf/src/embed.rs index 6ed65a2b6..f0cd9060a 100644 --- a/crates/typst-pdf/src/embed.rs +++ b/crates/typst-pdf/src/embed.rs @@ -34,6 +34,8 @@ pub(crate) fn embed_files( }, }; let data: Arc + Send + Sync> = Arc::new(embed.data.clone()); + // TODO: update when new krilla version lands (https://github.com/LaurenzV/krilla/pull/203) + let compress = should_compress(&embed.data).unwrap_or(true); let file = EmbeddedFile { path, @@ -41,7 +43,7 @@ pub(crate) fn embed_files( description, association_kind, data: data.into(), - compress: true, + compress, location: Some(span.into_raw().get()), }; @@ -52,3 +54,69 @@ pub(crate) fn embed_files( Ok(()) } + +fn should_compress(data: &[u8]) -> Option { + let ty = infer::get(data)?; + match ty.matcher_type() { + infer::MatcherType::App => None, + infer::MatcherType::Archive => match ty.mime_type() { + #[rustfmt::skip] + "application/zip" + | "application/vnd.rar" + | "application/gzip" + | "application/x-bzip2" + | "application/vnd.bzip3" + | "application/x-7z-compressed" + | "application/x-xz" + | "application/vnd.ms-cab-compressed" + | "application/vnd.debian.binary-package" + | "application/x-compress" + | "application/x-lzip" + | "application/x-rpm" + | "application/zstd" + | "application/x-lz4" + | "application/x-ole-storage" => Some(false), + _ => None, + }, + infer::MatcherType::Audio => match ty.mime_type() { + #[rustfmt::skip] + "audio/mpeg" + | "audio/m4a" + | "audio/opus" + | "audio/ogg" + | "audio/x-flac" + | "audio/amr" + | "audio/aac" + | "audio/x-ape" => Some(false), + _ => None, + }, + infer::MatcherType::Book => None, + infer::MatcherType::Doc => None, + infer::MatcherType::Font => None, + infer::MatcherType::Image => match ty.mime_type() { + #[rustfmt::skip] + "image/jpeg" + | "image/jp2" + | "image/png" + | "image/webp" + | "image/vnd.ms-photo" + | "image/heif" + | "image/avif" + | "image/jxl" + | "image/vnd.djvu" => None, + _ => None, + }, + infer::MatcherType::Text => None, + infer::MatcherType::Video => match ty.mime_type() { + #[rustfmt::skip] + "video/mp4" + | "video/x-m4v" + | "video/x-matroska" + | "video/webm" + | "video/quicktime" + | "video/x-flv" => Some(false), + _ => None, + }, + infer::MatcherType::Custom => None, + } +} diff --git a/crates/typst-realize/src/lib.rs b/crates/typst-realize/src/lib.rs index 151ae76ba..7d2460a89 100644 --- a/crates/typst-realize/src/lib.rs +++ b/crates/typst-realize/src/lib.rs @@ -655,6 +655,7 @@ fn visit_grouping_rules<'a>( let matching = s.rules.iter().find(|&rule| (rule.trigger)(content, &s.kind)); // Try to continue or finish an existing grouping. + let mut i = 0; while let Some(active) = s.groupings.last() { // Start a nested group if a rule with higher priority matches. if matching.is_some_and(|rule| rule.priority > active.rule.priority) { @@ -670,6 +671,16 @@ fn visit_grouping_rules<'a>( } finish_innermost_grouping(s)?; + i += 1; + if i > 512 { + // It seems like this case is only hit when there is a cycle between + // a show rule and a grouping rule. The show rule produces content + // that is matched by a grouping rule, which is then again processed + // by the show rule, and so on. The two must be at an equilibrium, + // otherwise either the "maximum show rule depth" or "maximum + // grouping depth" errors are triggered. + bail!(content.span(), "maximum grouping depth exceeded"); + } } // Start a new grouping. diff --git a/tests/ref/bibliography-basic.png b/tests/ref/bibliography-basic.png index 0844eaf81..86d02cc69 100644 Binary files a/tests/ref/bibliography-basic.png and b/tests/ref/bibliography-basic.png differ diff --git a/tests/ref/bibliography-before-content.png b/tests/ref/bibliography-before-content.png index eb9f26d83..a16ea1df5 100644 Binary files a/tests/ref/bibliography-before-content.png and b/tests/ref/bibliography-before-content.png differ diff --git a/tests/ref/bibliography-grid-par.png b/tests/ref/bibliography-grid-par.png index 5befbcc54..0757e92c5 100644 Binary files a/tests/ref/bibliography-grid-par.png and b/tests/ref/bibliography-grid-par.png differ diff --git a/tests/ref/bibliography-indent-par.png b/tests/ref/bibliography-indent-par.png index 02278124b..031e28974 100644 Binary files a/tests/ref/bibliography-indent-par.png and b/tests/ref/bibliography-indent-par.png differ diff --git a/tests/ref/bibliography-math.png b/tests/ref/bibliography-math.png index 6b60fef4a..6d6d88d53 100644 Binary files a/tests/ref/bibliography-math.png and b/tests/ref/bibliography-math.png differ diff --git a/tests/ref/bibliography-multiple-files.png b/tests/ref/bibliography-multiple-files.png index 3be3763f4..b2e7b0144 100644 Binary files a/tests/ref/bibliography-multiple-files.png and b/tests/ref/bibliography-multiple-files.png differ diff --git a/tests/ref/bibliography-ordering.png b/tests/ref/bibliography-ordering.png index c19b7e7d0..ad5e86019 100644 Binary files a/tests/ref/bibliography-ordering.png and b/tests/ref/bibliography-ordering.png differ diff --git a/tests/ref/block-consistent-width.png b/tests/ref/block-consistent-width.png index 045603cb8..f181bd335 100644 Binary files a/tests/ref/block-consistent-width.png and b/tests/ref/block-consistent-width.png differ diff --git a/tests/ref/cite-footnote.png b/tests/ref/cite-footnote.png index dd2cf8bdb..e89b1dc12 100644 Binary files a/tests/ref/cite-footnote.png and b/tests/ref/cite-footnote.png differ diff --git a/tests/ref/cite-form.png b/tests/ref/cite-form.png index a9fbe7515..91a6d2e26 100644 Binary files a/tests/ref/cite-form.png and b/tests/ref/cite-form.png differ diff --git a/tests/ref/cite-group.png b/tests/ref/cite-group.png index 02772f499..d512d07e0 100644 Binary files a/tests/ref/cite-group.png and b/tests/ref/cite-group.png differ diff --git a/tests/ref/cite-grouping-and-ordering.png b/tests/ref/cite-grouping-and-ordering.png index 8dea1b533..69c1db475 100644 Binary files a/tests/ref/cite-grouping-and-ordering.png and b/tests/ref/cite-grouping-and-ordering.png differ diff --git a/tests/ref/figure-basic.png b/tests/ref/figure-basic.png index 69388755f..eed77cc3a 100644 Binary files a/tests/ref/figure-basic.png and b/tests/ref/figure-basic.png differ diff --git a/tests/ref/footnote-basic.png b/tests/ref/footnote-basic.png index 44ace9035..7351bbb7f 100644 Binary files a/tests/ref/footnote-basic.png and b/tests/ref/footnote-basic.png differ diff --git a/tests/ref/footnote-block-at-end.png b/tests/ref/footnote-block-at-end.png index 09880aaba..15d0bb593 100644 Binary files a/tests/ref/footnote-block-at-end.png and b/tests/ref/footnote-block-at-end.png differ diff --git a/tests/ref/footnote-block-fr.png b/tests/ref/footnote-block-fr.png index 451e4d778..80781fd1d 100644 Binary files a/tests/ref/footnote-block-fr.png and b/tests/ref/footnote-block-fr.png differ diff --git a/tests/ref/footnote-break-across-pages-block.png b/tests/ref/footnote-break-across-pages-block.png index f2882dbcd..fd512950b 100644 Binary files a/tests/ref/footnote-break-across-pages-block.png and b/tests/ref/footnote-break-across-pages-block.png differ diff --git a/tests/ref/footnote-break-across-pages-float.png b/tests/ref/footnote-break-across-pages-float.png index 5d3ea1078..a343137b8 100644 Binary files a/tests/ref/footnote-break-across-pages-float.png and b/tests/ref/footnote-break-across-pages-float.png differ diff --git a/tests/ref/footnote-break-across-pages-nested.png b/tests/ref/footnote-break-across-pages-nested.png index f87658ce8..79b09cfb9 100644 Binary files a/tests/ref/footnote-break-across-pages-nested.png and b/tests/ref/footnote-break-across-pages-nested.png differ diff --git a/tests/ref/footnote-break-across-pages.png b/tests/ref/footnote-break-across-pages.png index 878227cb9..ba985d1eb 100644 Binary files a/tests/ref/footnote-break-across-pages.png and b/tests/ref/footnote-break-across-pages.png differ diff --git a/tests/ref/footnote-duplicate.png b/tests/ref/footnote-duplicate.png index b5a73f74b..e95228e48 100644 Binary files a/tests/ref/footnote-duplicate.png and b/tests/ref/footnote-duplicate.png differ diff --git a/tests/ref/footnote-entry.png b/tests/ref/footnote-entry.png index dd09acb92..9e0108f88 100644 Binary files a/tests/ref/footnote-entry.png and b/tests/ref/footnote-entry.png differ diff --git a/tests/ref/footnote-float-priority.png b/tests/ref/footnote-float-priority.png index 1017ed51c..7d649d55c 100644 Binary files a/tests/ref/footnote-float-priority.png and b/tests/ref/footnote-float-priority.png differ diff --git a/tests/ref/footnote-in-caption.png b/tests/ref/footnote-in-caption.png index 79b2b5d0f..cd4f837bb 100644 Binary files a/tests/ref/footnote-in-caption.png and b/tests/ref/footnote-in-caption.png differ diff --git a/tests/ref/footnote-in-columns.png b/tests/ref/footnote-in-columns.png index 281ec8836..8b5f1201d 100644 Binary files a/tests/ref/footnote-in-columns.png and b/tests/ref/footnote-in-columns.png differ diff --git a/tests/ref/footnote-in-list.png b/tests/ref/footnote-in-list.png index daf94e950..edb24156b 100644 Binary files a/tests/ref/footnote-in-list.png and b/tests/ref/footnote-in-list.png differ diff --git a/tests/ref/footnote-in-place.png b/tests/ref/footnote-in-place.png index b500ac80f..2f9681e23 100644 Binary files a/tests/ref/footnote-in-place.png and b/tests/ref/footnote-in-place.png differ diff --git a/tests/ref/footnote-in-table.png b/tests/ref/footnote-in-table.png index e110eac6d..2c7e42309 100644 Binary files a/tests/ref/footnote-in-table.png and b/tests/ref/footnote-in-table.png differ diff --git a/tests/ref/footnote-invariant.png b/tests/ref/footnote-invariant.png index a183ba7ab..23838c368 100644 Binary files a/tests/ref/footnote-invariant.png and b/tests/ref/footnote-invariant.png differ diff --git a/tests/ref/footnote-multiple-in-one-line.png b/tests/ref/footnote-multiple-in-one-line.png index 12def79ba..41faa1fb1 100644 Binary files a/tests/ref/footnote-multiple-in-one-line.png and b/tests/ref/footnote-multiple-in-one-line.png differ diff --git a/tests/ref/footnote-nested-break-across-pages.png b/tests/ref/footnote-nested-break-across-pages.png index 889fb0671..0903214c2 100644 Binary files a/tests/ref/footnote-nested-break-across-pages.png and b/tests/ref/footnote-nested-break-across-pages.png differ diff --git a/tests/ref/footnote-nested.png b/tests/ref/footnote-nested.png index 06617d984..365bef4e7 100644 Binary files a/tests/ref/footnote-nested.png and b/tests/ref/footnote-nested.png differ diff --git a/tests/ref/footnote-ref-call.png b/tests/ref/footnote-ref-call.png index afc103211..635865e41 100644 Binary files a/tests/ref/footnote-ref-call.png and b/tests/ref/footnote-ref-call.png differ diff --git a/tests/ref/footnote-ref-forward.png b/tests/ref/footnote-ref-forward.png index afb4d7cb5..f222b4be8 100644 Binary files a/tests/ref/footnote-ref-forward.png and b/tests/ref/footnote-ref-forward.png differ diff --git a/tests/ref/footnote-ref-in-footnote.png b/tests/ref/footnote-ref-in-footnote.png index 944985983..73901b479 100644 Binary files a/tests/ref/footnote-ref-in-footnote.png and b/tests/ref/footnote-ref-in-footnote.png differ diff --git a/tests/ref/footnote-ref-multiple.png b/tests/ref/footnote-ref-multiple.png index 899afca16..59e9fecef 100644 Binary files a/tests/ref/footnote-ref-multiple.png and b/tests/ref/footnote-ref-multiple.png differ diff --git a/tests/ref/footnote-ref.png b/tests/ref/footnote-ref.png index 812514eac..278f0e594 100644 Binary files a/tests/ref/footnote-ref.png and b/tests/ref/footnote-ref.png differ diff --git a/tests/ref/footnote-space-collapsing.png b/tests/ref/footnote-space-collapsing.png index bad0691fb..6936f3c13 100644 Binary files a/tests/ref/footnote-space-collapsing.png and b/tests/ref/footnote-space-collapsing.png differ diff --git a/tests/ref/footnote-styling.png b/tests/ref/footnote-styling.png index a68cca9dd..f9400ee7e 100644 Binary files a/tests/ref/footnote-styling.png and b/tests/ref/footnote-styling.png differ diff --git a/tests/ref/issue-1433-footnote-in-list.png b/tests/ref/issue-1433-footnote-in-list.png index a012e2345..19934a709 100644 Binary files a/tests/ref/issue-1433-footnote-in-list.png and b/tests/ref/issue-1433-footnote-in-list.png differ diff --git a/tests/ref/issue-1597-cite-footnote.png b/tests/ref/issue-1597-cite-footnote.png index 6ec017c76..e7c076b14 100644 Binary files a/tests/ref/issue-1597-cite-footnote.png and b/tests/ref/issue-1597-cite-footnote.png differ diff --git a/tests/ref/issue-2531-cite-show-set.png b/tests/ref/issue-2531-cite-show-set.png index 568c77e56..93b69b7d8 100644 Binary files a/tests/ref/issue-2531-cite-show-set.png and b/tests/ref/issue-2531-cite-show-set.png differ diff --git a/tests/ref/issue-3481-cite-location.png b/tests/ref/issue-3481-cite-location.png index 01139e25f..110ee4a24 100644 Binary files a/tests/ref/issue-3481-cite-location.png and b/tests/ref/issue-3481-cite-location.png differ diff --git a/tests/ref/issue-3699-cite-twice-et-al.png b/tests/ref/issue-3699-cite-twice-et-al.png index 62921dd64..46b98c39d 100644 Binary files a/tests/ref/issue-3699-cite-twice-et-al.png and b/tests/ref/issue-3699-cite-twice-et-al.png differ diff --git a/tests/ref/issue-4454-footnote-ref-numbering.png b/tests/ref/issue-4454-footnote-ref-numbering.png index a517d5fb4..bf23221ae 100644 Binary files a/tests/ref/issue-4454-footnote-ref-numbering.png and b/tests/ref/issue-4454-footnote-ref-numbering.png differ diff --git a/tests/ref/issue-4618-bibliography-set-heading-level.png b/tests/ref/issue-4618-bibliography-set-heading-level.png index 3bf2096e3..6de2bed29 100644 Binary files a/tests/ref/issue-4618-bibliography-set-heading-level.png and b/tests/ref/issue-4618-bibliography-set-heading-level.png differ diff --git a/tests/ref/issue-5256-multiple-footnotes-in-footnote.png b/tests/ref/issue-5256-multiple-footnotes-in-footnote.png index f9c173351..f32d192e6 100644 Binary files a/tests/ref/issue-5256-multiple-footnotes-in-footnote.png and b/tests/ref/issue-5256-multiple-footnotes-in-footnote.png differ diff --git a/tests/ref/issue-5354-footnote-empty-frame-infinite-loop.png b/tests/ref/issue-5354-footnote-empty-frame-infinite-loop.png index acad56b68..99da601ae 100644 Binary files a/tests/ref/issue-5354-footnote-empty-frame-infinite-loop.png and b/tests/ref/issue-5354-footnote-empty-frame-infinite-loop.png differ diff --git a/tests/ref/issue-5435-footnote-migration-in-floats.png b/tests/ref/issue-5435-footnote-migration-in-floats.png index 672a5af83..58d71fc72 100644 Binary files a/tests/ref/issue-5435-footnote-migration-in-floats.png and b/tests/ref/issue-5435-footnote-migration-in-floats.png differ diff --git a/tests/ref/issue-5489-matrix-stray-linebreak.png b/tests/ref/issue-5489-matrix-stray-linebreak.png new file mode 100644 index 000000000..2d278bd5c Binary files /dev/null and b/tests/ref/issue-5489-matrix-stray-linebreak.png differ diff --git a/tests/ref/issue-5496-footnote-in-float-never-fits.png b/tests/ref/issue-5496-footnote-in-float-never-fits.png index 4ae5903d8..85851f5ad 100644 Binary files a/tests/ref/issue-5496-footnote-in-float-never-fits.png and b/tests/ref/issue-5496-footnote-in-float-never-fits.png differ diff --git a/tests/ref/issue-5496-footnote-never-fits-multiple.png b/tests/ref/issue-5496-footnote-never-fits-multiple.png index 24fcf7098..000a10745 100644 Binary files a/tests/ref/issue-5496-footnote-never-fits-multiple.png and b/tests/ref/issue-5496-footnote-never-fits-multiple.png differ diff --git a/tests/ref/issue-5496-footnote-never-fits.png b/tests/ref/issue-5496-footnote-never-fits.png index 4ae5903d8..85851f5ad 100644 Binary files a/tests/ref/issue-5496-footnote-never-fits.png and b/tests/ref/issue-5496-footnote-never-fits.png differ diff --git a/tests/ref/issue-5496-footnote-separator-never-fits.png b/tests/ref/issue-5496-footnote-separator-never-fits.png index 4fe4fdee3..3b342619c 100644 Binary files a/tests/ref/issue-5496-footnote-separator-never-fits.png and b/tests/ref/issue-5496-footnote-separator-never-fits.png differ diff --git a/tests/ref/issue-5503-cite-group-interrupted-by-par-align.png b/tests/ref/issue-5503-cite-group-interrupted-by-par-align.png index 166331587..8c91ad552 100644 Binary files a/tests/ref/issue-5503-cite-group-interrupted-by-par-align.png and b/tests/ref/issue-5503-cite-group-interrupted-by-par-align.png differ diff --git a/tests/ref/issue-5503-cite-in-align.png b/tests/ref/issue-5503-cite-in-align.png index aeb72aa0d..eabc4dc3d 100644 Binary files a/tests/ref/issue-5503-cite-in-align.png and b/tests/ref/issue-5503-cite-in-align.png differ diff --git a/tests/ref/issue-622-hide-meta-cite.png b/tests/ref/issue-622-hide-meta-cite.png index c3c9b188a..1fe3f2519 100644 Binary files a/tests/ref/issue-622-hide-meta-cite.png and b/tests/ref/issue-622-hide-meta-cite.png differ diff --git a/tests/ref/issue-758-link-repeat.png b/tests/ref/issue-758-link-repeat.png index aaec20d23..5db44c314 100644 Binary files a/tests/ref/issue-758-link-repeat.png and b/tests/ref/issue-758-link-repeat.png differ diff --git a/tests/ref/issue-785-cite-locate.png b/tests/ref/issue-785-cite-locate.png index d387ed0d5..c80314544 100644 Binary files a/tests/ref/issue-785-cite-locate.png and b/tests/ref/issue-785-cite-locate.png differ diff --git a/tests/ref/issue-footnotes-skip-first-page.png b/tests/ref/issue-footnotes-skip-first-page.png index b7a8ce62c..7e4dbd566 100644 Binary files a/tests/ref/issue-footnotes-skip-first-page.png and b/tests/ref/issue-footnotes-skip-first-page.png differ diff --git a/tests/ref/linebreak-cite-punctuation.png b/tests/ref/linebreak-cite-punctuation.png index f544aca4d..8e9e945d0 100644 Binary files a/tests/ref/linebreak-cite-punctuation.png and b/tests/ref/linebreak-cite-punctuation.png differ diff --git a/tests/ref/linebreak-link-end.png b/tests/ref/linebreak-link-end.png index bcc88751c..43c771a85 100644 Binary files a/tests/ref/linebreak-link-end.png and b/tests/ref/linebreak-link-end.png differ diff --git a/tests/ref/linebreak-link-justify.png b/tests/ref/linebreak-link-justify.png index a80e30743..3175f657c 100644 Binary files a/tests/ref/linebreak-link-justify.png and b/tests/ref/linebreak-link-justify.png differ diff --git a/tests/ref/linebreak-link.png b/tests/ref/linebreak-link.png index 19eba3054..2f6b77eaa 100644 Binary files a/tests/ref/linebreak-link.png and b/tests/ref/linebreak-link.png differ diff --git a/tests/ref/link-basic.png b/tests/ref/link-basic.png index 0d2bd7533..f53223ffd 100644 Binary files a/tests/ref/link-basic.png and b/tests/ref/link-basic.png differ diff --git a/tests/ref/link-bracket-balanced.png b/tests/ref/link-bracket-balanced.png index 8b7e02db2..01bfa8797 100644 Binary files a/tests/ref/link-bracket-balanced.png and b/tests/ref/link-bracket-balanced.png differ diff --git a/tests/ref/link-bracket-unbalanced-closing.png b/tests/ref/link-bracket-unbalanced-closing.png index f54ad32c4..dbd418a0a 100644 Binary files a/tests/ref/link-bracket-unbalanced-closing.png and b/tests/ref/link-bracket-unbalanced-closing.png differ diff --git a/tests/ref/link-show.png b/tests/ref/link-show.png index ac6df7fef..69e70ac98 100644 Binary files a/tests/ref/link-show.png and b/tests/ref/link-show.png differ diff --git a/tests/ref/link-to-label.png b/tests/ref/link-to-label.png index 633ee9881..39433c13c 100644 Binary files a/tests/ref/link-to-label.png and b/tests/ref/link-to-label.png differ diff --git a/tests/ref/link-to-page.png b/tests/ref/link-to-page.png index 2dbf76778..d618f066b 100644 Binary files a/tests/ref/link-to-page.png and b/tests/ref/link-to-page.png differ diff --git a/tests/ref/link-trailing-period.png b/tests/ref/link-trailing-period.png index b458d201a..80e0bd70a 100644 Binary files a/tests/ref/link-trailing-period.png and b/tests/ref/link-trailing-period.png differ diff --git a/tests/ref/link-transformed.png b/tests/ref/link-transformed.png index 4efa32f3c..c391f080b 100644 Binary files a/tests/ref/link-transformed.png and b/tests/ref/link-transformed.png differ diff --git a/tests/ref/math-equation-numbering.png b/tests/ref/math-equation-numbering.png index b127a9a1d..9606b30dd 100644 Binary files a/tests/ref/math-equation-numbering.png and b/tests/ref/math-equation-numbering.png differ diff --git a/tests/ref/measure-citation-deeply-nested.png b/tests/ref/measure-citation-deeply-nested.png index 596c351eb..6711fc732 100644 Binary files a/tests/ref/measure-citation-deeply-nested.png and b/tests/ref/measure-citation-deeply-nested.png differ diff --git a/tests/ref/measure-citation-in-flow.png b/tests/ref/measure-citation-in-flow.png index 18617beda..83f92aac4 100644 Binary files a/tests/ref/measure-citation-in-flow.png and b/tests/ref/measure-citation-in-flow.png differ diff --git a/tests/ref/par-semantic-align.png b/tests/ref/par-semantic-align.png index eda496411..202236efe 100644 Binary files a/tests/ref/par-semantic-align.png and b/tests/ref/par-semantic-align.png differ diff --git a/tests/ref/quote-cite-format-author-date.png b/tests/ref/quote-cite-format-author-date.png index 4931969d5..dbd6a8d8f 100644 Binary files a/tests/ref/quote-cite-format-author-date.png and b/tests/ref/quote-cite-format-author-date.png differ diff --git a/tests/ref/quote-cite-format-label-or-numeric.png b/tests/ref/quote-cite-format-label-or-numeric.png index d1dadf0e2..22654a0d7 100644 Binary files a/tests/ref/quote-cite-format-label-or-numeric.png and b/tests/ref/quote-cite-format-label-or-numeric.png differ diff --git a/tests/ref/quote-cite-format-note.png b/tests/ref/quote-cite-format-note.png index 0cde539bd..bef078c9f 100644 Binary files a/tests/ref/quote-cite-format-note.png and b/tests/ref/quote-cite-format-note.png differ diff --git a/tests/ref/quote-inline.png b/tests/ref/quote-inline.png index c09faa3a8..9205d6839 100644 Binary files a/tests/ref/quote-inline.png and b/tests/ref/quote-inline.png differ diff --git a/tests/ref/ref-basic.png b/tests/ref/ref-basic.png index 79655eba9..d9068d93d 100644 Binary files a/tests/ref/ref-basic.png and b/tests/ref/ref-basic.png differ diff --git a/tests/ref/ref-form-page-unambiguous.png b/tests/ref/ref-form-page-unambiguous.png index e7baa2f2c..3b37f115b 100644 Binary files a/tests/ref/ref-form-page-unambiguous.png and b/tests/ref/ref-form-page-unambiguous.png differ diff --git a/tests/ref/ref-form-page.png b/tests/ref/ref-form-page.png index 52fde86d7..0cc29a4f1 100644 Binary files a/tests/ref/ref-form-page.png and b/tests/ref/ref-form-page.png differ diff --git a/tests/ref/ref-supplements.png b/tests/ref/ref-supplements.png index fd715339f..e400c1feb 100644 Binary files a/tests/ref/ref-supplements.png and b/tests/ref/ref-supplements.png differ diff --git a/tests/ref/show-text-citation-smartquote.png b/tests/ref/show-text-citation-smartquote.png index 604ecc24f..fc18b5a52 100644 Binary files a/tests/ref/show-text-citation-smartquote.png and b/tests/ref/show-text-citation-smartquote.png differ diff --git a/tests/ref/show-text-citation.png b/tests/ref/show-text-citation.png index a0e684935..e5ae8d317 100644 Binary files a/tests/ref/show-text-citation.png and b/tests/ref/show-text-citation.png differ diff --git a/tests/ref/show-text-in-citation.png b/tests/ref/show-text-in-citation.png index 392487bc8..6533a4f7c 100644 Binary files a/tests/ref/show-text-in-citation.png and b/tests/ref/show-text-in-citation.png differ diff --git a/tests/ref/table-header-citation.png b/tests/ref/table-header-citation.png index 462198078..b9463b044 100644 Binary files a/tests/ref/table-header-citation.png and b/tests/ref/table-header-citation.png differ diff --git a/tests/suite/layout/inline/linebreak.typ b/tests/suite/layout/inline/linebreak.typ index e4b04b245..86a900252 100644 --- a/tests/suite/layout/inline/linebreak.typ +++ b/tests/suite/layout/inline/linebreak.typ @@ -139,3 +139,11 @@ Some texts feature many longer words. Those are often exceedingly challenging to break in a visually pleasing way. + +--- issue-5489-matrix-stray-linebreak --- +#table( + columns: (70pt,) * 1, + align: horizon + center, + stroke: 0.6pt, + [$mat(2241/2210,-71/1105;-71/1105,147/1105)$], +) diff --git a/tests/suite/styling/show.typ b/tests/suite/styling/show.typ index e8ddf5534..f3d9efd55 100644 --- a/tests/suite/styling/show.typ +++ b/tests/suite/styling/show.typ @@ -258,3 +258,11 @@ I am *strong*, I am _emphasized_, and I am #[special]. = Hello *strong* + +--- issue-5690-oom-par-box --- +// Error: 3:6-5:1 maximum grouping depth exceeded +#show par: box + +Hello + +World