Repository navigation
pin panmirror to release/rstudio-parrot-balsam-01 - #19599
Draft
kevinushey wants to merge 2 commits into
Draft
kevinushey wants to merge 2 commits into
kevinushey wants to merge 2 commits into
Conversation
Picks up quarto-dev/quarto#1228, which fixes "RangeError: Position N out of range" when switching a document with a linked image and a trailing link from Source to Visual mode. Addresses #19588.
RStudio E2E - all platforms
No report was published; see the run log. All platforms - commit |
This branch has not been deployed
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.
Intent
Switching a document from Source to Visual mode fails with an error dialog,
RangeError: Position N out of range, when the document contains an image wrapped in a link ([](https://...)) and ends with a link. The reporter's attachment reproduces it every time the document goes back to Visual after the first load.Fixes #19588.
Approach
The cause is in panmirror, the visual editor, so the fix is quarto-dev/quarto#1228. During a
setMarkdownreload, thefigure-convertappend handler turns each linked image back into a figure, which lengthens the document. Thesync-heading-linkshandler then runs in the same transaction, scans link positions from the already-changed document, and shifts them by those same steps a second time. A link near the end of the document lands past the end, andresolve()throws. That PR maps each scanned position only through the steps added after its scan; its description has the details.This PR moves
PANMIRROR_BRANCHfromrelease/rstudio-parrot-balsamto a newrelease/rstudio-parrot-balsam-01independencies/common/install-panmirroranddependencies/windows/install-panmirror/clone-panmirror-repo.cmd. The pinned branch is treated as immutable, so the fix ships on a new numbered branch:release/rstudio-parrot-balsamplus acherry-pick -xof the quarto-dev/quarto#1228 merge commit.Draft until quarto-dev/quarto#1228 merges and
release/rstudio-parrot-balsam-01exists on quarto-dev/quarto; until then the install scripts' branch check fails CI.Automated Tests
The regression tests are in quarto-dev/quarto#1228 (
packages/editor/test/link-headings.test.ts). All three fail before that fix: two with the reportedRangeError, and the third with a stale link.End to end, with panmirror built from the fix and served by a dev server, a scratch Playwright spec (not checked in) toggles the reporter's document (CRLF and LF copies) Source -> Visual -> Source -> Visual twice with no error dialog. With the currently pinned panmirror, it fails on the first switch back to Visual.
QA Notes
visual_editor_rangeerror_repro.qmdattachment from Visual editor: "RangeError: Position N out of range" when toggling from Source, when document ends with a link and contains an image wrapped in a link #19588 (drop the.txtextension). It haseditor: visual, so it opens in Visual mode.RangeError: Position N out of range. After: the document switches with no error. Repeat a few times.visual_editor_rangeerror_control_passes.qmdattachment should keep switching cleanly.Documentation
None needed.
Checklist
NEWS.md