Skip to content

Fix LaTeX not being properly recognized#1137

Open
carla-at-wiris wants to merge 5 commits intorelease/v8.15.2from
fix/latex-recognition-multiple
Open

Fix LaTeX not being properly recognized#1137
carla-at-wiris wants to merge 5 commits intorelease/v8.15.2from
fix/latex-recognition-multiple

Conversation

@carla-at-wiris
Copy link
Contributor

@carla-at-wiris carla-at-wiris commented Feb 12, 2026

Description

When having multiple LaTeX on the same line, it was always recognizing the first one. This PR fixed that behavior by finding the LaTeX within the caret position, if any.

How should be tested? (Manual or Automated Tests)

Start and build the CKEditor 5 demo. Validate that multiple LaTeX in the same line are properly recognized when trying to edit them.

To avoid having to build the project, go to the staging demo for this branch and CKEditor 5: https://integrations.wiris.kitchen/fix/latex-recognition-multiple/html/ckeditor5/

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes LaTeX detection when multiple $$...$$ blocks appear on the same line by selecting the LaTeX block associated with the caret position.

Changes:

  • Updates LaTeX boundary detection to target the LaTeX extracted at the caret.
  • Simplifies caret-in-LaTeX detection to rely on LaTeX extraction logic.
  • Enhances LaTeX extraction to locate the $$...$$ block that contains the caret offset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 7 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants