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: space should prevent optional argument to \\ #3746

Merged
merged 2 commits into from Dec 7, 2022
Merged

Conversation

edemaine
Copy link
Member

@edemaine edemaine commented Nov 1, 2022

Fix src/functions/cr.js's definition of \\ to manually look for an optional argument via future() instead of numOptionalArgs, so that it does not skip over spaces. This matches the existing behavior of \\ in src/environments/array.js and AMSMath's behavior of \math@cr via \new@ifnextchar.

Fixes #3745; see that for details.

Fix `src/functions/cr.js`'s definition of `\\` to manually look for an
optional argument via `future()` instead of `numOptionalArgs`, so that
it does *not* skip over spaces.  This matches the existing behavior of
`\\` in `src/environments/array.js` and AMSMath's behavior of `\math@cr`
via `\new@ifnextchar`.

Fixes #3745
Copy link
Collaborator

@ronkok ronkok left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@codecov
Copy link

codecov bot commented Dec 7, 2022

Codecov Report

Merging #3746 (f2120cb) into main (3db8e34) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3746   +/-   ##
=======================================
  Coverage   92.98%   92.98%           
=======================================
  Files          91       91           
  Lines        6769     6770    +1     
  Branches     1572     1574    +2     
=======================================
+ Hits         6294     6295    +1     
  Misses        437      437           
  Partials       38       38           
Impacted Files Coverage Δ
src/functions/cr.js 100.00% <100.00%> (ø)

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 3db8e34...f2120cb. Read the comment docs.

@ronkok
Copy link
Collaborator

ronkok commented Dec 7, 2022

@edemaine Thank for following up on this.

@ronkok ronkok merged commit a0deb34 into main Dec 7, 2022
@ronkok ronkok deleted the space-after-newline branch December 7, 2022 23:01
KaTeX-bot added a commit that referenced this pull request Dec 7, 2022
## [0.16.4](v0.16.3...v0.16.4) (2022-12-07)

### Bug Fixes

* space should prevent optional argument to \\ ([#3746](#3746)) ([a0deb34](a0deb34)), closes [#3745](#3745)
@KaTeX-bot
Copy link
Member

🎉 This PR is included in version 0.16.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

The error "KaTeX parse error: Invalid size" occurred when using \\ [
3 participants