Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements functionality to ensure that text before and after term lists (definition lists in Typst) are treated as separate paragraphs, addressing issue #32.
Key changes:
- Added logic to detect and handle term items at the document root level, preventing them from being incorrectly grouped with surrounding text
- Implemented splitting of paragraphs that contain mixed term items and regular text into separate paragraph and term item nodes
- Added comprehensive test fixtures covering term lists with and without surrounding blank lines
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/typstToTextlintAst.ts |
Added splitParagraphTermlist function to split paragraphs containing term items, added collectConsecutiveRootTermItems function to collect consecutive term items at root level, and modified paragraph grouping logic to handle term items specially |
test/unit/fixtures/paragraph-between-term-list/input.typ |
New test fixture input with term lists surrounded by paragraphs, both with and without blank lines |
test/unit/fixtures/paragraph-between-term-list/output.json |
Expected AST output showing proper separation of paragraphs and term items |
test/unit/fixtures/List/input.typ |
Extended existing list test to include term items after regular lists |
test/unit/fixtures/List/output.json |
Updated expected output to include the new term items in the test |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
close #32