Fix issues with line breaks and spacing in SVG output. (mathjax/MathJax#3166) #1043
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.
This issue fixes several issues with in-line line breaking in SVG mode that arise when extra spacing is placed around operators, as is done by
\implies
, orA\;+\;B
, for example. When in-line breaks are allowed, SVG output will lose the spacing around the operator (both the extra spacing as well as the normal operator spacing).Both issues are cause primarily by the
computeLineBBox()
function for the SVGmspace
wrapper. The size of the space was lost because the width was not being added to theLineBBox
, and the operator spacing was lost because theisFirst
property was assuming that the mspace had no width (i.e., was used for line-breaking only).I also moved
* scale
inside a conditional since there is no need to multiply 0 by the scale.The
LineBBox.append()
is modified to make sure thatoriginalL
is not lost if it has already been set earlier on.Resolves issue mathjax/MathJax#3166.