From 0ef672c347f368325313c8bccc4f70e3f1016b0a Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 4 Jul 2024 12:57:40 +0200 Subject: Refactor line building (#4497) --- tests/suite/foundations/version.typ | 2 +- tests/suite/layout/spacing.typ | 12 ++++++------ tests/suite/model/par.typ | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 7 deletions(-) (limited to 'tests/suite') diff --git a/tests/suite/foundations/version.typ b/tests/suite/foundations/version.typ index bf2cadb1..a4be7f13 100644 --- a/tests/suite/foundations/version.typ +++ b/tests/suite/foundations/version.typ @@ -4,7 +4,7 @@ // Test version constructor. // Empty. -#version() +#test(array(version()), ()) // Plain. #test(version(1, 2).major, 1) diff --git a/tests/suite/layout/spacing.typ b/tests/suite/layout/spacing.typ index dd0fced5..c32e6c8f 100644 --- a/tests/suite/layout/spacing.typ +++ b/tests/suite/layout/spacing.typ @@ -47,14 +47,14 @@ Totally #h() ignored Hello #h(2cm, weak: true) --- issue-4087 --- -// weak space at the end of the line would be removed. +// Weak space at the end of the line is removed. This is the first line #h(2cm, weak: true) A new line -// non-weak space would be consume a specified width and push next line. +// Non-weak space consumes a specified width and pushes to next line. This is the first line #h(2cm, weak: false) A new line -// similarly weak space at the beginning of the line would be removed. -This is the first line\ #h(2cm, weak: true) A new line +// Similarly, weak space at the beginning of the line is removed. +This is the first line \ #h(2cm, weak: true) A new line -// non-spacing, on the other hand, is not removed. -This is the first line\ #h(2cm, weak: false) 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 diff --git a/tests/suite/model/par.typ b/tests/suite/model/par.typ index f07c4c6c..80bc9f3e 100644 --- a/tests/suite/model/par.typ +++ b/tests/suite/model/par.typ @@ -78,3 +78,22 @@ Welcome \ here. Does this work well? #set text(dir: rtl) لآن وقد أظلم الليل وبدأت النجوم تنضخ وجه الطبيعة التي أعْيَتْ من طول ما انبعثت في النهار + +--- par-trailing-whitespace --- +// Ensure that trailing whitespace layouts as intended. +#box(fill: aqua, " ") + +--- par-empty-metadata --- +// Check that metadata still works in a zero length paragraph. +#block(height: 0pt)[#""#metadata(false)] +#context test(query().first().value, false) + +--- par-metadata-after-trimmed-space --- +// Ensure that metadata doesn't prevent trailing spaces from being trimmed. +#set par(justify: true, linebreaks: "simple") +#set text(hyphenate: false) +Lorem ipsum dolor #metadata(none) nonumy eirmod tempor. + +--- issue-4278-par-trim-before-equation --- +#set par(justify: true) +#lorem(6) aa $a = c + b$ -- cgit v1.2.3