Fix problem with \| being stretchy when it shouldn't be. (mathjax/MathJax#2632) #600
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.
Semantic enrichment together with certain TeX input can cause
\|
to be stretchy when it shouldn't. For example,\|X^X\|_x,
can cause the problem. This is due to the fact that\|
produces U+2225, which normally is not stretchy, but should be when used as delimiters with\left
and\right
. In order to accommodate that, the operator dictionary added U+2225 in prefix and postfix positions withstretchy="true"
, making the stretchy attribute different in infix from the other positions.Because the TeX input jax removes attributes that are the defaults for the given nodes, the expression
\|X^X\|_x,
has\|_x
in infix position (as an embellished operator), and so the U+2225 hasstretchy="false"
andfence="false"
as defaults, and so these attributes that had been added explicitly by\|
are removed in thecleanAttributes
post-filter (that is not the case for the initial one, since it is in prefix position, where the defaults aretrue
for those attributes). But when enriched, the result is that\|X^X\|_x
is placed in an mrow (with the comma outside), and so the\|_x
is now in prefix position, where it defaults to being a stretchy fence.The basis of the problem is the different stretchability for infix versus pre- and postfix positions, which was due to an addition to the table to make the poor TeX mapping of the delimiter
\|
to U+2225 work. This PR resolves the problem by removing the changes to the operator dictionary for U+2225, and instead, having the delimiters\|
and\Vert
map to U+2016.Resolves issue mathjax/MathJax#2632.