mirror of
https://github.com/typst/typst
synced 2025-05-13 20:46:23 +08:00
Merge branch 'main' into add/lang-in-ref
This commit is contained in:
commit
99ce1230a1
@ -259,10 +259,11 @@ impl Show for Packed<EnumElem> {
|
||||
.spanned(self.span());
|
||||
|
||||
if tight {
|
||||
let leading = ParElem::leading_in(styles);
|
||||
let spacing =
|
||||
VElem::new(leading.into()).with_weak(true).with_attach(true).pack();
|
||||
realized = spacing + realized;
|
||||
let spacing = self
|
||||
.spacing(styles)
|
||||
.unwrap_or_else(|| ParElem::leading_in(styles).into());
|
||||
let v = VElem::new(spacing.into()).with_weak(true).with_attach(true).pack();
|
||||
realized = v + realized;
|
||||
}
|
||||
|
||||
Ok(realized)
|
||||
|
@ -166,10 +166,11 @@ impl Show for Packed<ListElem> {
|
||||
.spanned(self.span());
|
||||
|
||||
if tight {
|
||||
let leading = ParElem::leading_in(styles);
|
||||
let spacing =
|
||||
VElem::new(leading.into()).with_weak(true).with_attach(true).pack();
|
||||
realized = spacing + realized;
|
||||
let spacing = self
|
||||
.spacing(styles)
|
||||
.unwrap_or_else(|| ParElem::leading_in(styles).into());
|
||||
let v = VElem::new(spacing.into()).with_weak(true).with_attach(true).pack();
|
||||
realized = v + realized;
|
||||
}
|
||||
|
||||
Ok(realized)
|
||||
|
@ -189,13 +189,15 @@ impl Show for Packed<TermsElem> {
|
||||
.styled(TermsElem::set_within(true));
|
||||
|
||||
if tight {
|
||||
let leading = ParElem::leading_in(styles);
|
||||
let spacing = VElem::new(leading.into())
|
||||
let spacing = self
|
||||
.spacing(styles)
|
||||
.unwrap_or_else(|| ParElem::leading_in(styles).into());
|
||||
let v = VElem::new(spacing.into())
|
||||
.with_weak(true)
|
||||
.with_attach(true)
|
||||
.pack()
|
||||
.spanned(span);
|
||||
realized = spacing + realized;
|
||||
realized = v + realized;
|
||||
}
|
||||
|
||||
Ok(realized)
|
||||
|
BIN
tests/ref/issue-6242-tight-list-attach-spacing.png
Normal file
BIN
tests/ref/issue-6242-tight-list-attach-spacing.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 410 B |
@ -304,3 +304,11 @@ World
|
||||
- C
|
||||
- = D
|
||||
E
|
||||
|
||||
--- issue-6242-tight-list-attach-spacing ---
|
||||
// Nested tight lists should be uniformly spaced when list spacing is set.
|
||||
#set list(spacing: 1.2em)
|
||||
- A
|
||||
- B
|
||||
- C
|
||||
- C
|
||||
|
Loading…
x
Reference in New Issue
Block a user