mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 03:38:39 +00:00
Fix \\ and \newline after operator (#1796)
* Fix \\ and \newline after operator Fix #1790. `\\` and `\newline` render as a span with classes `mspace` and `newline`. We need to check for `newline` when bringing spaces into the same `base` group. * Add tests and comment
This commit is contained in:
committed by
Kevin Barabash
parent
1a7ce6cf15
commit
8346294bf3
@@ -3405,6 +3405,15 @@ describe("Newlines via \\\\ and \\newline", function() {
|
||||
expect`a\\b\begin{matrix}x&y\\z&w\end{matrix}\\c`
|
||||
.toParseLike`a\newline b\begin{matrix}x&y\cr z&w\end{matrix}\newline c`;
|
||||
});
|
||||
|
||||
it("\\\\ causes newline, even after mrel and mop", () => {
|
||||
const markup = katex.renderToString(r`M = \\ a + \\ b \\ c`);
|
||||
// Ensure newlines appear outside base spans (because, in this regexp,
|
||||
// base span occurs immediately after each newline span).
|
||||
expect(markup).toMatch(
|
||||
/(<span class="base">.*?<\/span><span class="mspace newline"><\/span>){3}<span class="base">/);
|
||||
expect(markup).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe("Symbols", function() {
|
||||
|
Reference in New Issue
Block a user