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

Improve MathML for \not #1923

Merged
merged 5 commits into from Apr 6, 2019
Merged

Improve MathML for \not #1923

merged 5 commits into from Apr 6, 2019

Conversation

ronkok
Copy link
Collaborator

@ronkok ronkok commented Apr 4, 2019

This PR resolves a long-standing TODO item by implementing \not in MathML. The code employed is similar to the code used for HTML \not prior to PR #1497.

@codecov-io
Copy link

Codecov Report

Merging #1923 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1923      +/-   ##
==========================================
+ Coverage   94.82%   94.84%   +0.01%     
==========================================
  Files          79       79              
  Lines        4776     4788      +12     
  Branches      842      847       +5     
==========================================
+ Hits         4529     4541      +12     
  Misses        223      223              
  Partials       24       24
Flag Coverage Δ
#screenshotter 89.34% <100%> (+0.2%) ⬆️
#test 85.79% <46.15%> (-0.12%) ⬇️
Impacted Files Coverage Δ
src/macros.js 97.2% <100%> (ø) ⬆️
src/buildMathML.js 98.9% <100%> (+0.16%) ⬆️

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 ec777b8...a604627. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Apr 4, 2019

Codecov Report

Merging #1923 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1923      +/-   ##
==========================================
+ Coverage   94.82%   94.83%   +<.01%     
==========================================
  Files          79       79              
  Lines        4776     4783       +7     
  Branches      842      845       +3     
==========================================
+ Hits         4529     4536       +7     
  Misses        223      223              
  Partials       24       24
Flag Coverage Δ
#screenshotter 89.33% <100%> (+0.18%) ⬆️
#test 85.84% <50%> (-0.07%) ⬇️
Impacted Files Coverage Δ
src/macros.js 97.2% <100%> (ø) ⬆️
src/buildMathML.js 98.83% <100%> (+0.1%) ⬆️

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 0708835...a12f5d2. Read the comment docs.

@@ -151,7 +151,29 @@ export const buildExpression = function(
lastGroup = group;
Copy link
Member

@ylemkimon ylemkimon Apr 5, 2019

Choose a reason for hiding this comment

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

I think we can combine with the loop above, looping only once with the same or less number of checks:

            // Combine \not with mrels and mords
/*L#148*/   } else if (lastGroup.type === 'mi' && lastGroup.children.length === 1) {
                const lastChild = lastGroup.children[0];
                if (lastChild instanceof TextNode && lastChild.text === '\u0338' &&
                    (group.type === 'mo' || group.type === 'mi' || group.type === 'mn')) {
                    const child = group.children[0];
                    if (child instanceof TextNode && child.text.length > 0) {
                        // Overlay with combining character long solidus
                        child.text = child.text.slice(0, 1) + "\u0338" + child.text.slice(1);
                        groups.pop();
                    }
                }
            }

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

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

Successfully merging this pull request may close these issues.

None yet

3 participants