Work around negative space bug in Chrome#1194
Merged
k4b7 merged 3 commits intoKaTeX:masterfrom Mar 9, 2018
Merged
Conversation
This was referenced Mar 3, 2018
Codecov Report
@@ Coverage Diff @@
## master #1194 +/- ##
=======================================
Coverage 79.62% 79.62%
=======================================
Files 59 59
Lines 3882 3882
Branches 654 654
=======================================
Hits 3091 3091
Misses 658 658
Partials 133 133Continue to review full report at Codecov.
|
0caffab to
a69e20a
Compare
Fix KaTeX#984 The screenshot test is still somewhat defective, showing a space before the "post" text (a period). This seems limited to the screenshotter, however, as it works fine in the tester via http://localhost:7936/?text=%5Cfbox%7B%5C%241%2C%5C!000%2C%5C!000%7D%5CKaTeX&display=0&after=.
3 tasks
Member
|
I'm not sure why the circleci tests are failing but it doesn't matter b/c they aren't required checks. |
Member
|
@edemaine thanks for the PR. |
Closed
ylemkimon
added a commit
that referenced
this pull request
Jul 13, 2020
The new screenshot is correct as per #1194.
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.
Fix #984 and fix #1191 by working around this Chromium bug.
There seem to be two effects of the Chrome negative spacing bug:
This is fixed by changing.mspacefromdisplay:inline-blocktodisplay:inline. Alas, while this fixes negative spaces, it breaks (destroys) positive spaces.This is fixed by setting.baseto havewidth: min-contentas suggested by @ronkok in Avoid negative space in \bmod. #984.Both are fixed by
.katexto havewidth: min-contentas suggested by @ronkok in #984. This is automatically inherited by all elements that don't define an explicit width likewidth: 100%.The included screenshot test is still somewhat defective, showing a space before the period. This seems limited to the screenshotter, however, as it works fine in the tester via http://localhost:7936/?text=%5Cfbox%7B%5C%241%2C%5C!000%2C%5C!000%7D%5CKaTeX&display=0&after=. (with #1193 merged in for no-display-mode support). I tried upgrading the screenshotter (selenium/standalone-chrome from 2.48.2 to latest), but I could still not get the screenshotter to align with actual Chrome's rendering.
Here's an illustration of how it works with the tester:

Old screenshot test for comparison:

You can also see the problem in two places on the KaTeX front page (note space before colon!):
Manually changing the CSS in Chrome results in a good rendering:
