From 521ceae889f15f2a93683ab776cd86a423e5dbed Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 11 Dec 2024 16:46:10 +0100 Subject: Fix crash due to consecutive weak spacing (#5562) --- .../ref/issue-5244-consecutive-weak-space-heading.png | Bin 0 -> 346 bytes tests/ref/issue-5244-consecutive-weak-space.png | Bin 0 -> 194 bytes tests/ref/issue-5253-consecutive-weak-space-math.png | Bin 0 -> 138 bytes tests/suite/layout/spacing.typ | 18 ++++++++++++++++++ 4 files changed, 18 insertions(+) create mode 100644 tests/ref/issue-5244-consecutive-weak-space-heading.png create mode 100644 tests/ref/issue-5244-consecutive-weak-space.png create mode 100644 tests/ref/issue-5253-consecutive-weak-space-math.png (limited to 'tests') diff --git a/tests/ref/issue-5244-consecutive-weak-space-heading.png b/tests/ref/issue-5244-consecutive-weak-space-heading.png new file mode 100644 index 00000000..c1ef7924 Binary files /dev/null and b/tests/ref/issue-5244-consecutive-weak-space-heading.png differ diff --git a/tests/ref/issue-5244-consecutive-weak-space.png b/tests/ref/issue-5244-consecutive-weak-space.png new file mode 100644 index 00000000..7a102ddf Binary files /dev/null and b/tests/ref/issue-5244-consecutive-weak-space.png differ diff --git a/tests/ref/issue-5253-consecutive-weak-space-math.png b/tests/ref/issue-5253-consecutive-weak-space-math.png new file mode 100644 index 00000000..a15646ca Binary files /dev/null and b/tests/ref/issue-5253-consecutive-weak-space-math.png differ diff --git a/tests/suite/layout/spacing.typ b/tests/suite/layout/spacing.typ index f5938995..d5cd122c 100644 --- a/tests/suite/layout/spacing.typ +++ b/tests/suite/layout/spacing.typ @@ -58,3 +58,21 @@ This is the first line \ #h(2cm, weak: true) A new line // Non-weak-spacing, on the other hand, is not removed. This is the first line \ #h(2cm, weak: false) A new line + +--- issue-5244-consecutive-weak-space --- +#set par(linebreaks: "optimized") +#{ + [A] + h(0.3em, weak: true) + h(0.3em, weak: true) + [B] +} + +--- issue-5244-consecutive-weak-space-heading --- +#set par(justify: true) +#set heading(numbering: "I.") + += #h(0.3em, weak: true) test + +--- issue-5253-consecutive-weak-space-math --- +$= thin thin$ a -- cgit v1.2.3