mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-12 06:28:40 +00:00
Fix \hphantom width (#1809)
* Fix \hphantom width * Spin up phony screenshot test * Make better choice of smash screenshot test * Real screenshotter test * Add strict mode * Fix lint error * useStrictBehavior * Revert to previous strict setting * useStrictBehavior "phantomSpacing" * Fix tests via nonstrictSettings * Fix documentation * Remove bin|rel
This commit is contained in:
@@ -71,7 +71,8 @@ defineFunction({
|
||||
children: [{type: "elem", elem: node}],
|
||||
}, options);
|
||||
|
||||
return node;
|
||||
// For spacing, TeX treats \smash as a math group (same spacing as ord).
|
||||
return buildCommon.makeSpan(["mord"], [node], options);
|
||||
},
|
||||
mathmlBuilder: (group, options) => {
|
||||
const inner = mml.buildExpression(ordargument(group.body), options);
|
||||
|
@@ -55,7 +55,7 @@ defineFunction({
|
||||
},
|
||||
htmlBuilder: (group, options) => {
|
||||
const node = buildCommon.makeSpan(
|
||||
["mord"], [html.buildGroup(group.body, options)]);
|
||||
[], [html.buildGroup(group.body, options)]);
|
||||
|
||||
if (!group.smashHeight && !group.smashDepth) {
|
||||
return node;
|
||||
@@ -85,10 +85,13 @@ defineFunction({
|
||||
// makeVList applies "display: table-cell", which prevents the browser
|
||||
// from acting on that line height. So we'll call makeVList now.
|
||||
|
||||
return buildCommon.makeVList({
|
||||
const smashedNode = buildCommon.makeVList({
|
||||
positionType: "firstBaseline",
|
||||
children: [{type: "elem", elem: node}],
|
||||
}, options);
|
||||
|
||||
// For spacing, TeX treats \hphantom as a math group (same spacing as ord).
|
||||
return buildCommon.makeSpan(["mord"], [smashedNode], options);
|
||||
},
|
||||
mathmlBuilder: (group, options) => {
|
||||
const node = new mathMLTree.MathNode(
|
||||
|
Reference in New Issue
Block a user