From ae59a8b25ed3c5378e8bcf6abb3b7434b9bf7fea Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 10 Jan 2026 12:29:47 -0500 Subject: [PATCH] fix: Skip math content in tables rule to preserve LaTeX escape sequences (#11134) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #10255 where LaTeX commands containing \n (like \neg, \neq, \nu) were being incorrectly interpreted as newline characters when pasted. The tables rule was processing all inline content and splitting on \n sequences, which broke LaTeX math expressions. This fix skips processing for math_inline tokens, similar to the existing skip for code_inline. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.5 --- shared/editor/rules/tables.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shared/editor/rules/tables.ts b/shared/editor/rules/tables.ts index cd22a8dcea..63c9394468 100644 --- a/shared/editor/rules/tables.ts +++ b/shared/editor/rules/tables.ts @@ -24,6 +24,12 @@ export default function markdownTables(md: MarkdownIt): void { tokens[i].children = []; existing.forEach((child) => { + // Skip processing math content to preserve LaTeX escape sequences + if (child.type === "math_inline") { + tokens[i].children?.push(child); + return; + } + let content = child.content; // First handle
tags