mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Fix alignment of list markers & enum numbers (#988)
This commit is contained in:
parent
f740c0b03f
commit
ae4accc071
@ -194,7 +194,8 @@ impl Layout for EnumElem {
|
|||||||
};
|
};
|
||||||
|
|
||||||
cells.push(Content::empty());
|
cells.push(Content::empty());
|
||||||
cells.push(resolved);
|
// avoid '#set align' interference with the enum
|
||||||
|
cells.push(resolved.aligned(Align::LEFT_TOP.into()));
|
||||||
cells.push(Content::empty());
|
cells.push(Content::empty());
|
||||||
cells.push(item.body().styled(Self::set_parents(Parent(number))));
|
cells.push(item.body().styled(Self::set_parents(Parent(number))));
|
||||||
number = number.saturating_add(1);
|
number = number.saturating_add(1);
|
||||||
|
@ -129,7 +129,11 @@ impl Layout for ListElem {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let depth = self.depth(styles);
|
let depth = self.depth(styles);
|
||||||
let marker = self.marker(styles).resolve(vt, depth)?;
|
let marker = self
|
||||||
|
.marker(styles)
|
||||||
|
.resolve(vt, depth)?
|
||||||
|
// avoid '#set align' interference with the list
|
||||||
|
.aligned(Align::LEFT_TOP.into());
|
||||||
|
|
||||||
let mut cells = vec![];
|
let mut cells = vec![];
|
||||||
for item in self.children() {
|
for item in self.children() {
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 16 KiB |
Binary file not shown.
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 20 KiB |
@ -34,3 +34,11 @@ See 0.3. \
|
|||||||
Empty \
|
Empty \
|
||||||
+Nope \
|
+Nope \
|
||||||
a + 0.
|
a + 0.
|
||||||
|
|
||||||
|
---
|
||||||
|
// Alignment shouldn't affect number
|
||||||
|
#set align(horizon)
|
||||||
|
|
||||||
|
+ ABCDEF\ GHIJKL\ MNOPQR
|
||||||
|
+ INNER\ INNER\ INNER
|
||||||
|
+ BACK\ HERE
|
||||||
|
@ -49,3 +49,9 @@ _Shopping list_
|
|||||||
-
|
-
|
||||||
Not in list
|
Not in list
|
||||||
-Nope
|
-Nope
|
||||||
|
|
||||||
|
---
|
||||||
|
// Alignment shouldn't affect marker
|
||||||
|
#set align(horizon)
|
||||||
|
|
||||||
|
- ABCDEF\ GHIJKL\ MNOPQR
|
||||||
|
Loading…
x
Reference in New Issue
Block a user