mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-10 05:28:41 +00:00
Prevent line breaks immediately after math
For whatever reason, `<inline-block/>,` allows a break in between the block and the comma. `<nobr><inline-block/></nobr>,` doesn't. Auditors: emily
This commit is contained in:
@@ -535,7 +535,9 @@ var buildTree = function(tree) {
|
|||||||
topStrut.style.height = span.height + "em";
|
topStrut.style.height = span.height + "em";
|
||||||
bottomStrut.style.height = (span.height + span.depth) + "em";
|
bottomStrut.style.height = (span.height + span.depth) + "em";
|
||||||
|
|
||||||
var katexNode = makeSpan(["katex"], [topStrut, bottomStrut, span]);
|
var katexNode = makeSpan(["katex"], [
|
||||||
|
makeSpan(["katex-inner"], [topStrut, bottomStrut, span])
|
||||||
|
]);
|
||||||
|
|
||||||
return katexNode.toDOM();
|
return katexNode.toDOM();
|
||||||
};
|
};
|
||||||
|
@@ -6,11 +6,17 @@ big parens
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
.katex {
|
.katex {
|
||||||
display: inline-block;
|
|
||||||
font: normal 1.21em katex_main;
|
font: normal 1.21em katex_main;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
|
.katex-inner {
|
||||||
|
// Making .katex inline-block allows line breaks before and after,
|
||||||
|
// which is undesireable ("to $x$,"). Instead, adjust the .katex-inner
|
||||||
|
// style and put nowrap on the inline .katex element.
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
.base {
|
.base {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user