Fix unicode_minus + usetex.#14567
Merged
timhoffm merged 1 commit intomatplotlib:masterfrom Jun 19, 2019
Merged
Conversation
... by telling TeX to treat \u2212 (unicode minus) as a minus sign.
This also uncovered a bug in _parse_enc (basically, there can be
multiple character entries per line, so one needs to use `.split()`
instead of `.split("\n")`.
dstansby
approved these changes
Jun 18, 2019
timhoffm
reviewed
Jun 18, 2019
| no_comments = "\n".join(line.split("%")[0].rstrip() for line in file) | ||
| array = re.search(r"(?s)\[(.*)\]", no_comments).group(1) | ||
| lines = [line for line in array.split("\n") if line] | ||
| lines = [line for line in array.split() if line] |
Contributor
Author
There was a problem hiding this comment.
Because the previous version was buggy: on an encoding file like http://tug.ctan.org/info/fontname/8r.enc, you can see there are multiple entries per line (/.notdef /dotaccent /...) and lines are starting with a space, so the previous parser would fail immediately below when asserting that all lines start with a /, and even without the assertion, would misparse the file.
timhoffm
approved these changes
Jun 19, 2019
6 tasks
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.
... by telling TeX to treat \u2212 (unicode minus) as a minus sign.
This also uncovered a bug in _parse_enc (basically, there can be
multiple character entries per line, so one needs to use
.split()instead of
.split("\n").Closes #8423 (more accurately, #8423 (comment); the original version of the bug is already closed by #11381).
PR Summary
PR Checklist