This is used by Harlowe's toolbar for block-level markup, like headers. Since they must start on a new line, the toolbar buttons runs cm.doc.replaceSelection("\n#" + wrapped, "around"); (paraphrased) where "wrapped" is whatever text was highlighted at the time.
Notably, this does NOT crash 2.3!
Some visual aides:
Fig.1. Before clicking.
Fig.2. The replacement is shown, but soon afterward...
Fig.3. The error occurs.
Twine version number
2.4.0-beta3
Does this problem occur with the web version of Twine or the desktop app?
Web
What operating system does this problem occur on?
Windows
If this problem is occurring with the web version of Twine, what browser does it occur on?
Firefox
Presubmission checklist
[ ] I am interested in working on code that would fix this bug. (This is not required to submit a bug report.)
[X] I have done a search and believe that an issue does not already exist for this bug in the GitHub repository.
[X] I have read and agree to abide by this project's Code of Conduct.
This reads like an issue with CM but I need to try to repro this on my side to understand better. If it's with CM, you might have to work around it. I can try upgrading CM (2.4 is on 5.65.1, there is 5.65.3) but the changelog doesn't mention this issue.
This is used by Harlowe's toolbar for block-level markup, like headers. Since they must start on a new line, the toolbar buttons runs
cm.doc.replaceSelection("\n#" + wrapped, "around");
(paraphrased) where "wrapped" is whatever text was highlighted at the time.Notably, this does NOT crash 2.3!
Some visual aides: Fig.1. Before clicking. Fig.2. The replacement is shown, but soon afterward... Fig.3. The error occurs.
Twine version number
2.4.0-beta3
Does this problem occur with the web version of Twine or the desktop app?
Web
What operating system does this problem occur on?
Windows
If this problem is occurring with the web version of Twine, what browser does it occur on?
Firefox
Presubmission checklist