Skip to content

Conversation

@mcanouil
Copy link
Collaborator

@mcanouil mcanouil commented Jan 30, 2026

Ensure terms and their descriptions remain together by preventing breaks within definition items.

The rule needs to be separate from the content rule, because here we play on the implicit block generated by Typst.

As this is a visual change, there are no tests, but I believe non breaking term/definition is a sensible default.

CodeBeforeAfter
---
title: "Quarto Playground"
format: typst
keep-typ: true
---

## Introduction

{{< lipsum 4 >}}

Multi-format output
: Generate HTML, PDF, Word, ePub, and more from one source.
Two-page document showing Quarto Playground title page with Lorem Ipsum text with at the bottom Multi-format output followed on the facing page with definition in centered box Two-page document showing Quarto Playground title page with Lorem Ipsum text and facing page with Multi-format output definition in centered box

Ensure that terms and their descriptions remain together by setting the block to be non-breakable.
@mcanouil mcanouil self-assigned this Jan 30, 2026
@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Jan 30, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@mcanouil mcanouil changed the title fix: prevent breaking inside definition items fix(typst): prevent breaking inside definition items Jan 30, 2026
@mcanouil mcanouil marked this pull request as ready for review January 30, 2026 10:57
@mcanouil mcanouil requested a review from cderv January 30, 2026 11:00
Verifies that definition list terms and descriptions stay on the same page
and that descriptions are indented from terms.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gordonwoodhull
Copy link
Contributor

I added a test using ensurePdfTextPositions. Without the fix, it reports

Cannot compare positions: "Generate HTML" is on page 2, "Multi-format" is on page 1    

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, is this ensurePdfTextPositions new?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants