diff options
| author | Etienne Collin <collin.etienne.media@gmail.com> | 2024-04-02 04:13:13 -0400 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2024-05-17 14:27:58 +0200 |
| commit | c5e094757db9b7d520969afb472e3efbc9aeb920 (patch) | |
| tree | 61f7839a64706393b2db0a3411cf168f32aac2b3 | |
| parent | 8529ffe701d54d62aaa96493a825f56dd1c61a46 (diff) | |
Fixed interaction of first_line_indent with outline (#3745)
| -rw-r--r-- | crates/typst/src/model/outline.rs | 7 | ||||
| -rw-r--r-- | tests/ref/meta/outline-first-par-indent.png | bin | 0 -> 28062 bytes | |||
| -rw-r--r-- | tests/typ/meta/outline-first-par-indent.typ | 15 |
3 files changed, 20 insertions, 2 deletions
diff --git a/crates/typst/src/model/outline.rs b/crates/typst/src/model/outline.rs index 6fb1f601..15ce3d55 100644 --- a/crates/typst/src/model/outline.rs +++ b/crates/typst/src/model/outline.rs @@ -10,8 +10,10 @@ use crate::foundations::{ NativeElement, Packed, Show, ShowSet, Smart, StyleChain, Styles, }; use crate::introspection::{Counter, CounterKey, Locatable}; -use crate::layout::{BoxElem, Fr, HElem, HideElem, Length, Rel, RepeatElem, Spacing}; -use crate::model::{Destination, HeadingElem, NumberingPattern, ParbreakElem, Refable}; +use crate::layout::{BoxElem, Em, Fr, HElem, HideElem, Length, Rel, RepeatElem, Spacing}; +use crate::model::{ + Destination, HeadingElem, NumberingPattern, ParElem, ParbreakElem, Refable, +}; use crate::syntax::Span; use crate::text::{Lang, LinebreakElem, LocalName, Region, SpaceElem, TextElem}; use crate::util::{option_eq, NonZeroExt}; @@ -265,6 +267,7 @@ impl ShowSet for Packed<OutlineElem> { let mut out = Styles::new(); out.set(HeadingElem::set_outlined(false)); out.set(HeadingElem::set_numbering(None)); + out.set(ParElem::set_first_line_indent(Em::new(0.0).into())); out } } diff --git a/tests/ref/meta/outline-first-par-indent.png b/tests/ref/meta/outline-first-par-indent.png Binary files differnew file mode 100644 index 00000000..f6e4ffe8 --- /dev/null +++ b/tests/ref/meta/outline-first-par-indent.png diff --git a/tests/typ/meta/outline-first-par-indent.typ b/tests/typ/meta/outline-first-par-indent.typ new file mode 100644 index 00000000..77396634 --- /dev/null +++ b/tests/typ/meta/outline-first-par-indent.typ @@ -0,0 +1,15 @@ +#set par(first-line-indent: 1.5em) +#set heading(numbering: "1.1.a.") +#show outline.entry.where(level: 1): it => { + v(0.5em, weak: true) + strong(it) +} + +#outline() + += Introduction += Background +== History +== State of the Art += Analysis +== Setup |
