Repository navigation
Fix navigation braille in no-unsafe builds - #865
Closed
venkatesh6114 wants to merge 1 commit into
Closed
venkatesh6114 wants to merge 1 commit into
venkatesh6114 wants to merge 1 commit into
Conversation
Copy focused MathML nodes into the temporary document only when the no-unsafe backend is enabled. Preserve the existing default-feature path and add feature-gated regression coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Linux library size: 0.58 MiB (0.00%)
Built with default features, Rust 1.96.0, and Ubuntu 24.04. Workflow run. |
Collaborator
|
Thanks for spotting the bug and explaining what the problem is. I am committing a different fix (b13ec5a) that avoids the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a panic in
get_navigation_braillewhen MathCAT is compiled with theno-unsafefeature.When the navigation focus is below the outer
<math>element,get_navigation_braillecreates a temporary document and wraps the focused node in a new<math>element. Previously, the copied node was allocated in the original document and then appended to the temporary document.The default backend happens to tolerate this cross-document insertion, but the
no-unsafebackend uses document-local indices and can panic with an out-of-bounds error.Changes
no-unsafe-specific helper that recursively copies a MathML subtree into a specified destination document.<math>element.copy_mathmlpath for builds withoutno-unsafe.get_navigation_braille.Compatibility
The behavior change is limited to builds compiled with the
no-unsafefeature:#[cfg(feature = "no-unsafe")]Fixes #827