fix: Do not inject list indent into literal block content - #25
Conversation
visit_Text joined multi-line text nodes with "\n{self._hi.indent}",
which is correct for prose (continuation lines inside a list item need
the hanging indent) but wrong for literal_block content: Typst raw
fenced blocks are verbatim, so any whitespace injected between lines
appears in the rendered output.
The fix reuses the existing _in_literal() helper — already used to
suppress character escaping inside code blocks — to select a plain "\n"
separator when the text node is inside a literal context.
A composite test case is added under tests/cases-composite/code/ to
cover a code block nested inside an enumerated list item, which was the
failing pattern.
|
Warning Review limit reached
Next review available in: 56 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
visit_Text joined multi-line text nodes with "\n{self._hi.indent}",
which is correct for prose (continuation lines inside a list item need
the hanging indent) but wrong for literal_block content: Typst raw
fenced blocks are verbatim, so any whitespace injected between lines
appears in the rendered output.
The fix reuses the existing _in_literal() helper — already used to
suppress character escaping inside code blocks — to select a plain "\n"
separator when the text node is inside a literal context.
A composite test case is added under tests/cases-composite/code/ to
cover a code block nested inside an enumerated list item, which was the
failing pattern.