Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(array): Keep single empty row in AMS environments #2947

Merged
merged 3 commits into from
Apr 24, 2021

Conversation

edemaine
Copy link
Member

I experimented in LaTeX, and it seems that {align}, {align*}, and even {aligned} environments (basically, all AMS environments) keep a single empty row if there is one, but remove a trailing empty row otherwise. This PR implements this behavior.

This in particular prevents empty equation-numbered environment (e.g. {align}) from crashing (fix #2944).

In particular prevents empty equation-numbered environment (e.g. `{align}`)
from crashing.

Fix #2944
@edemaine edemaine requested a review from ronkok April 21, 2021 15:38
@codecov-commenter
Copy link

codecov-commenter commented Apr 24, 2021

Codecov Report

Merging #2947 (e490941) into master (bc718a0) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2947      +/-   ##
==========================================
+ Coverage   93.92%   93.94%   +0.01%     
==========================================
  Files          87       87              
  Lines        6326     6327       +1     
  Branches     1308     1309       +1     
==========================================
+ Hits         5942     5944       +2     
+ Misses        354      353       -1     
  Partials       30       30              
Impacted Files Coverage Δ
src/environments/array.js 98.32% <100.00%> (+<0.01%) ⬆️
src/environments/cd.js 99.15% <0.00%> (+0.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc718a0...e490941. Read the comment docs.

@ylemkimon ylemkimon enabled auto-merge (squash) April 24, 2021 19:23
@ylemkimon ylemkimon merged commit 24332e0 into master Apr 24, 2021
@ylemkimon ylemkimon deleted the empty-single-row branch April 24, 2021 19:28
KaTeX-bot added a commit that referenced this pull request Apr 24, 2021
## [0.13.3](v0.13.2...v0.13.3) (2021-04-24)

### Bug Fixes

* Respect catcode in macro expansion and set ~'s catcode correctly ([#2949](#2949)) ([01ae7f8](01ae7f8)), closes [#2924](#2924)
* **array:** Keep single empty row in AMS environments ([#2947](#2947)) ([24332e0](24332e0)), closes [#2944](#2944)
@KaTeX-bot
Copy link
Member

🎉 This PR is included in version 0.13.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@edemaine
Copy link
Member Author

@ylemkimon Thanks for the reviews!

How did you do a release with two PR fixes in it? (this one and #2949)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty top-level environment crashes
4 participants