GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(markdown): an escaped backslash before \( no longer crashes dev b… · NikitaMGrimm/t3code@26e6c1a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/shared/src
    • markdownMath.test.ts
  • patches
    • [email protected]
  • pnpm-lock.yaml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/shared/src/markdownMath.test.ts‎

Copy file name to clipboardExpand all lines: packages/shared/src/markdownMath.test.ts
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,15 @@ describe("chat math parsing", () => {
181181
expect(formulas("Pay \\$$x$ now.")).toEqual([["inline", "x"]]);
182182
});
183183

184+
it("starts a formula right after an escaped backslash", () => {
185+
const markdown = "Path \\\\\\(x^2\\) and \\\\\\[y\\].";
186+
expect(formulas(markdown)).toEqual([
187+
["inline", "x^2"],
188+
["display", "y"],
189+
]);
190+
expect(text(markdown)).toBe("Path \\ and \\.");
191+
});
192+
184193
it.each([
185194
["$a`$HOME`", "$HOME"],
186195
["\\(a`\\)`", "\\)"],
Collapse file

‎patches/[email protected]‎

Copy file name to clipboardExpand all lines: patches/[email protected]
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,16 @@ diff --git a/dev/lib/math-tex-text.js b/dev/lib/math-tex-text.js
232232
effects.consume(code)
233233
effects.exit('mathTextSequence')
234234
effects.exit('mathText')
235+
@@ -180,5 +184,8 @@
236+
*/
237+
function previous(code) {
238+
// If there is a previous code, there will always be a tail.
239+
- return code !== codes.backslash
240+
+ return (
241+
+ code !== codes.backslash ||
242+
+ this.events[this.events.length - 1][1].type === types.characterEscape
243+
+ )
244+
}
235245
diff --git a/dev/lib/math-text.js b/dev/lib/math-text.js
236246
--- a/dev/lib/math-text.js
237247
+++ b/dev/lib/math-text.js
Collapse file

‎pnpm-lock.yaml‎

Copy file name to clipboardExpand all lines: pnpm-lock.yaml
+3-3Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.