You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Backslashes added to citations @ signs when switching to visual mode #11279
RStudio Edition : Desktop & Server
RStudio Version : RStudio-2022.02.2-485 and 2022.06.0-daily+421
OS Version : MacOS 12.4, Ubuntu 20.04 via Chrome on MacOS 12.4
R Version : 4.2.0
Note that the file has to be saved. So if tried by copying the contents of README.Rmd into a new file, the new file first needs to be saved before the behavior occurs.
Describe the problem in detail
Backslashes are added to the citations, so @ becomes \@ and is no longer treated as a citation. For example,
I am also experiencing this when switching between source and visual editor. I have a reproducible example up on my github. I get a backslash if there is a call to equations with custom prefixes in the same sentence, or if there is no space between the closing parentheses around the figure cross reference and the citation.
For example:
This in source editor
Will properly render to this
However if I switch to visual editor and then back, backslashes have now been added by around the reference
So now it renders to this
I'm using R 4.2.0, Rstudio version "2022.06.0-daily+512" and quarto-version: 0.9.254
The other issue is quite complicated to untangle, and I don't think something we can fix for this release (too much risk of regression). Let's validate the first fix and then keep the bug open for the EG release.
The behavior in the original bug report appears to now be fixed in the latest writer code (I did some work on citation escaping a couple of months ago that likely resolved it). Not sure if there are other behaviors described here that should also be verified?
Activity
ailich commentedon Jun 13, 2022
I am also experiencing this when switching between source and visual editor. I have a reproducible example up on my github. I get a backslash if there is a call to equations with custom prefixes in the same sentence, or if there is no space between the closing parentheses around the figure cross reference and the citation.
For example:

This in source editor
Will properly render to this

However if I switch to visual editor and then back, backslashes have now been added by around the reference

So now it renders to this

I'm using R 4.2.0, Rstudio version "2022.06.0-daily+512" and quarto-version: 0.9.254
jjallaire commentedon Jun 14, 2022
The README.Rmd issue is fixed here: 36db347
Will investigate the other report now.
jjallaire commentedon Jun 14, 2022
The other issue is quite complicated to untangle, and I don't think something we can fix for this release (too much risk of regression). Let's validate the first fix and then keep the bug open for the EG release.
ronblum commentedon Jun 15, 2022
Verified that the README behavior is now correct. Moving to next release for part 2.
jjallaire commentedon Feb 9, 2023
The behavior in the original bug report appears to now be fixed in the latest writer code (I did some work on citation escaping a couple of months ago that likely resolved it). Not sure if there are other behaviors described here that should also be verified?
ronblum commentedon Feb 14, 2023
Verified that the second issue, with cross references, is now resolved as well. Tested in RStudio Desktop 2023.03.0-daily+318 on MacOS 13.2.