Repository navigation
fix(array): preserve tags on empty final rows - #4277
Conversation
Greptile SummaryThis PR preserves an otherwise removable empty final array row when that row carries a manual tag.
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness or security issues identified. The manual-tag representation is uniquely array-valued, and retaining its row restores body/tag alignment while preserving existing cleanup for automatic and disabled tags. Important Files Changed
Reviews (1): Last reviewed commit: "fix(array): preserve tags on empty final..." | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4277 +/- ##
==========================================
+ Coverage 93.15% 93.45% +0.29%
==========================================
Files 91 92 +1
Lines 6795 6858 +63
Branches 1582 1609 +27
==========================================
+ Hits 6330 6409 +79
- Misses 429 447 +18
+ Partials 36 2 -34
... and 16 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
Thank you, looks good! |
edemaine
left a comment
There was a problem hiding this comment.
Looks good! I confirmed against pdfLaTeX with amsmath: preserving an empty final row carrying \tag or \tag* matches LaTeX, including empty tags and tags combined with \nonumber. The Array.isArray check looks appropriate.
One other discrepancy I noticed: LaTeX distinguishes align from aligned. A bare trailing \\ creates another row in align, including automatic numbering, but is discarded in aligned. KaTeX currently discards it in both. Something we might want to fix someday... though its kind of annoying behavior.
## [0.18.6](v0.18.5...v0.18.6) (2026-09-05) ### Bug Fixes * **array:** preserve tags on empty final rows ([#4277](#4277)) ([02d552c](02d552c))
|
🎉 This PR is included in version 0.18.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What is the previous behavior before this PR?
An explicit
\tagon an empty final row of analignenvironment is recorded, but the row is then removed as a trailing empty row. This leaves the row and tag arrays out of alignment, so the visible tag column is empty.What is the new behavior after this PR?
Final empty rows are retained when they carry a manual tag. Automatic empty trailing rows and rows disabled with
\nonumbercontinue to be removed.The regression test fails on the previous implementation because the visible tag span is absent and passes with the fix.
Validation:
tsc --noEmit)git diff --checkFixes #3898