Why justification doesn't work in par-like headings with long words?

Today I was caught off guard when I tried to enable par.justify after disabling text.hyphenate, but nothing has happened after that. What’s the problem here?

#set text(lang: "ru")
#set par(justify: true)
#set heading(numbering: "1.")
// Doesn't help:
// #set par(justification-limits: (spacing: (min: 50%, max: 500%)))
#show heading: set text(hyphenate: false)
#show heading: set par(justify: true) // Doesn't work.
#show heading: it => block(par(
  counter(heading).display() + h(0.3em) + it.body,
))
#show heading: upper
= Влияние логистики на издержки и конкурентоспособность
= #text(spacing: 2.08em)[Влияние логистики на издержки и конкурентоспособность]
#text(16pt, hyphenate: false, upper[*2.#h(0.3em)Влияние логистики на издержки и конкурентоспособность*])
#lorem(20)

It seems like it is caused by the block element the headers are wrapped in, if you set the heading block to take the full width, justification works as expected.

Edit: It seems like the issue is tracked in #5472 opened by Andrew :joy:

1 Like

Wait, it’s that one all over again? Well, ok, the block thingy does make sense, so that’s good. Thanks.

1 Like