fix(tui): parse multiline LaTeX arguments

Closes #7760
This commit is contained in:
Vegard Stikbakke 2026-08-11 12:37:45 +02:00
parent 7915cdac64
commit 452923b54a
4 changed files with 4 additions and 1 deletions

View file

@ -16,6 +16,7 @@
### Fixed
- Fixed fullscreen transcript search snapping back to the current match during manual scrolling and fragmented mouse input leaking into the search query.
- Fixed inherited required LaTeX arguments starting on a new line being parsed as empty ([#7760](https://github.com/earendil-works/pi/issues/7760)).
## [0.84.1] - 2026-08-07

View file

@ -14,6 +14,7 @@
### Fixed
- Fixed fullscreen transcript search snapping back to the current match during manual scrolling and fragmented SGR mouse input leaking into the search query.
- Fixed required LaTeX arguments starting on a new line being parsed as empty ([#7760](https://github.com/earendil-works/pi/issues/7760)).
## [0.84.1] - 2026-08-07

View file

@ -1145,7 +1145,7 @@ class LatexParser {
}
private parseRequiredArgumentValue(): string {
while (this.position < this.source.length && /[ \t]/.test(this.source[this.position] ?? "")) {
while (this.position < this.source.length && /\s/.test(this.source[this.position] ?? "")) {
this.position++;
}
if (this.position >= this.source.length) {

View file

@ -443,6 +443,7 @@ R\left(\frac{\pi}{4}\right)
" -b±√(b²-4ac)\nx = ────────────\n 2a",
);
assert.strictEqual(renderLatex(String.raw`\frac{x^2+1}{x-1}`, { display: true }), "x²+1\n────\nx-1");
assert.strictEqual(renderLatex("\\frac{1}\n{2}", { display: true }), "1\n─\n2");
});
it("keeps nested display fractions linear", () => {