quarto-dev / quarto

Quarto open-source scientific and technical publishing system
https://quarto.org
GNU Affero General Public License v3.0
323 stars 27 forks source link

Triple dots are replaced by an ellipsis when copy-pasting in a Quarto document #279

Closed ronblum closed 11 months ago

ronblum commented 1 year ago

Bug description

This original issue is at https://github.com/rstudio/rstudio/issues/12257

Triple dots are replaced by an ellipsis when copy-pasting in a Quarto document.

Steps to reproduce

  1. Create a new Quarto document.
  2. Switch to visual mode if not already in it.
  3. Copy this text and paste it in the body: dat <- data.frame(a...a = 1)
    • The ... in the variable name are pasted as an ellipsis resulting in invalid code.

Expected behavior

Triple dots should be pasted as dots instead of a single ellipsis character.

Actual behavior

Triple dots are replaced by an ellipsis when copy-pasting in a Quarto document.

Your environment

RStudio Edition : Desktop
RStudio Version : RStudio 2022.07.3+582 and 2023.09.0+463
OS Version      : Windows 10
R Version       : 3.6.3 and 4.2.1 

This works correctly on MacOS 14 in RStudio Desktop 2023.09.0+463 with R 4.3.1.

Quarto check output

C:\Program Files\RStudio\resources\app\bin\quarto\bin>quarto check
A new release of Deno is available: 1.28.2 → 1.37.0 Run `deno upgrade` to install it.

[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.3.433
      Path: C:\Program Files\RStudio\resources\app\bin\quarto\bin
      CodePage: 1252

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.11.5
      Path: C:/Program Files/Python311/python.exe
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with py -m pip install jupyter

[>] Checking R installation...........OK
      Version: 3.6.3
      Path: C:/PROGRA~1/R/R-36~1.3
      LibPaths:
        - C:/Users/Ron Blum/Documents/R/win-library/3.6
        - C:/Program Files/R/R-3.6.3/library
[>] Checking Knitr engine render......OK
      rmarkdown: 2.25
cderv commented 1 year ago

@jjallaire is this something we handle on Quarto side ?

ronblum commented 1 year ago

@cderv I might've put this in the wrong repo—this is for the visual editor.

jjallaire commented 1 year ago

This should be fixed here: https://github.com/quarto-dev/quarto/commit/f145de384d986494057236b6ebe91704df863ce2

ronblum commented 1 year ago

Thanks! I marked it for RStudio testing in the rstudio/rstudio repo.

ronblum commented 12 months ago

@jj This is still happening in the latest. Here's a simpler reprex:

  1. Open a Quarto document in visual mode.
  2. Create an R chunk.
  3. Type a...a in the chunk.
    • The periods show up as three dots.
  4. Copy the a...a from the chunk.
  5. Paste in the body of the document.
    • The periods show up as one ellipsis.
  6. Copy the a...a from the body.
  7. Paste in the chunk.
    • The periods show up as one ellipsis, tighter than in the body (step 6).
  8. Switch to source mode.
    • In the body, the three pasted dots are periods.
    • In the chunk, the three pasted dots are an ellipsis.

Source mode:

```{r}
a...a
a…a

a...a



Visual mode:

![Image](https://github.com/rstudio/rstudio/assets/31009952/034305ea-3871-4b62-bb00-25fbd1952b7f)
jjallaire commented 11 months ago

Thanks for flagging this! Should be fixed once and for all here: https://github.com/quarto-dev/quarto/commit/b6fda6b283a7ad0275f8fbf775eacec300ff7fee