diff --git a/buildTree.js b/buildTree.js index 372283f51..8416cb06d 100644 --- a/buildTree.js +++ b/buildTree.js @@ -339,13 +339,17 @@ var groupTypes = { }, llap: function(group, options, prev) { - var inner = makeSpan([], [buildGroup(group.value, options.reset())]); - return makeSpan(["llap", options.style.cls()], [inner]); + var inner = makeSpan( + ["inner"], [buildGroup(group.value, options.reset())]); + var fix = makeSpan(["fix"], []); + return makeSpan(["llap", options.style.cls()], [inner, fix]); }, rlap: function(group, options, prev) { - var inner = makeSpan([], [buildGroup(group.value, options.reset())]); - return makeSpan(["rlap", options.style.cls()], [inner]); + var inner = makeSpan( + ["inner"], [buildGroup(group.value, options.reset())]); + var fix = makeSpan(["fix"], []); + return makeSpan(["rlap", options.style.cls()], [inner, fix]); }, punct: function(group, options, prev) { diff --git a/static/katex.less b/static/katex.less index fca4e6412..fc716482a 100644 --- a/static/katex.less +++ b/static/katex.less @@ -275,16 +275,20 @@ big parens width: 0; position: relative; - > span { + > .inner { position: absolute; } + + > .fix { + display: inline-block; + } } - .llap > span { + .llap > .inner { right: 0; } - .rlap > span { + .rlap > .inner { left: 0; } diff --git a/test/huxley/Huxleyfile b/test/huxley/Huxleyfile index f486316a1..3d9bbbb2a 100644 --- a/test/huxley/Huxleyfile +++ b/test/huxley/Huxleyfile @@ -39,3 +39,6 @@ url=http://localhost:7936/test/huxley/test.html?m=\frac{a}{b}\text{c~ {ab} \ e}+ [KaTeX] url=http://localhost:7936/test/huxley/test.html?m=\KaTeX + +[RlapBug] +url=http://localhost:7936/test/huxley/test.html?m=\rlap{x} \ No newline at end of file diff --git a/test/huxley/RlapBug.huxley/record.json b/test/huxley/RlapBug.huxley/record.json new file mode 100644 index 000000000..9369c51e8 --- /dev/null +++ b/test/huxley/RlapBug.huxley/record.json @@ -0,0 +1 @@ +{"py/object": "huxley.run.Test", "screen_size": {"py/tuple": [1024, 768]}, "steps": [{"py/object": "huxley.steps.ScreenshotTestStep", "index": 0, "offset_time": 0}]} diff --git a/test/huxley/RlapBug.huxley/screenshot0.png b/test/huxley/RlapBug.huxley/screenshot0.png new file mode 100644 index 000000000..dea85a2ab Binary files /dev/null and b/test/huxley/RlapBug.huxley/screenshot0.png differ