Repository navigation
UnicodeMath: write what reads back, and read two spaces after a comma - #37
Merged
Merged
Conversation
…ces after a comma Four equations that read from UnicodeMath and were written as text that read back to another equation: - a script of a matrix in brackets: ⒨(𝑎&𝑏@𝑐&𝑑)² read the ² apart from the matrix (and ^−1 did not parse); the matrix is grouped, 〖⒨(…)〗², as the other bases that a script would not apply to whole - a function in a denominator: 𝑎/ sin𝛼 read as a slash, the space after the bar ending the fraction; the space is not written, 𝑎/sin𝛼 - a denominator that ends with a script before an operand: 1/4𝜋𝜀₀ 𝑞₁𝑞₂/𝑟² took 𝑞₁𝑞₂/𝑟² into the denominator, the space ending the script and not the denominator; it is in parentheses, 1/(4𝜋𝜀₀) (but not after superscript digits, 𝜕²/𝜕𝑥² 𝜓, which a space ends, nor before an operator) - ", " (a comma and two spaces, a space of ½ em after the comma in the grammar) was read as an empty <mo/>, which nothing writes: it is the space of that width, U+2002, as ", " reads Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SyVio8afJsGwHW9i5v5HDs
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four equations that read from UnicodeMath but were written as text that read back to another equation (found with the formulas of the math tools app):
(■(a&b@c&d))^2⒨(𝑎&𝑏@𝑐&𝑑)²²apart (and^−1did not parse)〖⒨(𝑎&𝑏@𝑐&𝑑)〗²a/sinα𝑎/ sin𝛼𝑎/sin𝛼1/(4πε_0) (q_1 q_2)/r^21/4𝜋𝜀₀ 𝑞₁𝑞₂/𝑟²𝑞₁𝑞₂/𝑟²in the denominator: the space ends the script, not the denominator1/(4𝜋𝜀₀) 𝑞₁𝑞₂/𝑟²a, b𝑎,𝑏<mo/>𝑎, 𝑏(U+2002)⒨ ⒱ ⒩ ⓢ Ⓢ): the matrix is grouped as a script base, inScriptBaseandBinary, as the other bases a script would not apply to whole.𝜕²/𝜕𝑥² 𝜓), which a space ends. Subscript digits (𝑥₁) do need it.,: the grammar reads it as a comma and a space of 9/18 em,{space: 9}, whichTransformSpacesdid not handle. It is now the character of that width, U+2002, as,reads. Width 0 (the empty cell of a matrix) stays an empty<mo/>, as before.The parentheses rule changes the text written only in those cases. The 738 examples of the corpus and the round trips stay at 100%.
Tests
Regression/WriterRoundTripTests.UnicodeMathReadsBackWhatItWrites: 12 cases. 9 failed before the fix (3 already passed), all pass now.Regression/WriterRoundTripTests.UnicodeMathReadsTwoSpacesAfterACommaAsASpace.dotnet test --project tests/SharpEquations.Tests: 6984/6984 on net10.0 and net8.0.[no-new-version]: bumpVersionPrefixif you want it released.Generated by Claude Code