In parallel to the Typst issue #38, the SILE package is affected by the same limitation. The only difference is I can see how to potentially navigate out of it, at least for direct markup. I'm not sure if we can catch the case of function output.
Fixing this will be pretty involved as each segments needs to get passed with it's siblings and/or parent content, but the casing changes only applied to the content element at each level.
Current results using the same input as used in the Typst MWE:

In parallel to the Typst issue #38, the SILE package is affected by the same limitation. The only difference is I can see how to potentially navigate out of it, at least for direct markup. I'm not sure if we can catch the case of function output.
Fixing this will be pretty involved as each segments needs to get passed with it's siblings and/or parent content, but the casing changes only applied to the content element at each level.
Current results using the same input as used in the Typst MWE: