Skip to content

Comments

fix(web): prevent LaTeX from being cut at \right] or \big) in agent o…#13155

Open
Eruis2579 wants to merge 1 commit intoinfiniflow:mainfrom
Eruis2579:fix/13134-latex-rendering
Open

fix(web): prevent LaTeX from being cut at \right] or \big) in agent o…#13155
Eruis2579 wants to merge 1 commit intoinfiniflow:mainfrom
Eruis2579:fix/13134-latex-rendering

Conversation

@Eruis2579
Copy link

…utput

  • Use negative lookbehind (?<![a-zA-Z]) so ] and ) inside commands (e.g. \right], \big)) are not treated as block/inline delimiters
  • Use greedy matching to capture up to the last valid delimiter, fixing truncated formulas (e.g. C_{seq}(y|x) = \frac{1}{|y|} ...)
  • Add unit tests for preprocessLaTeX

Closes #13134

What problem does this PR solve?

Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR.

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

…utput

- Use negative lookbehind (?<![a-zA-Z]) so \] and \) inside commands
  (e.g. \right], \big)) are not treated as block/inline delimiters
- Use greedy matching to capture up to the last valid delimiter,
  fixing truncated formulas (e.g. C_{seq}(y|x) = \frac{1}{|y|} ...)
- Add unit tests for preprocessLaTeX

Closes infiniflow#13134
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: LaTeX rendering is still broken

1 participant