Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visual editor quote and en-dash symbol conversion creates unintended source markdown #9680

Closed
jjallaire opened this issue Jul 29, 2021 · 5 comments
Assignees
Labels
bug visual markdown

Comments

@jjallaire
Copy link
Member

@jjallaire jjallaire commented Jul 29, 2021

Discussion here:

https://community.rstudio.com/t/how-to-disable-symbol-conversion-in-rstudio-visual-markdown-mode-to-prevent-damage-of-content/110725

@jjallaire jjallaire added bug visual markdown backlog labels Jul 29, 2021
@jjallaire jjallaire self-assigned this Jul 29, 2021
@GegznaV
Copy link

@GegznaV GegznaV commented Jul 30, 2021

I copy the original message here:


I use R Markdown editor in RStudio (1.4.1717). I created .Rmd file with contents like this:

The closing quote must not be changed „here“.

Interval -2–-1: the combination of – (en dash) and hyphen must not be changed into ---

enter image description here

After switching to Visual Markdown and back to regular markdown editor, the contents were changed into:

The closing quote must not be changed „here".

Interval -2---1: the combination of -- (en dash) and hyphen must not be changed into ---

enter image description here

The same happens when I save the Rmd file in the Visual Markdown editor.

  • Here was changed into ". In English, it would be OK, but in my language, these are two different symbols. The text got distorted in an unwanted way.
  • Next, interval "from minus two to minus one" was converted into "from minus two to (plus) one". This changed the meaning of the content.

Sometimes I copy-paste pieces of text into R Markdown file, sometimes I want to use Visual mode on old Rmd files in which non-Englis language is used. If these conversions happen and the user does not notice them on time, the damage can irreversible.

Question: How can these unwanted symbol conversions be reliably disabled in RStudio?

@jjallaire
Copy link
Member Author

@jjallaire jjallaire commented Sep 13, 2021

With this commit (9ee2790), this can now be prevented by disabling the smart extension for the editor:

---
title: "My Document"
editor_options:
  markdown:
    extensions: -smart
---

@jjallaire jjallaire added test and removed backlog labels Sep 13, 2021
@valerie-rstudio valerie-rstudio self-assigned this Sep 27, 2021
@valerie-rstudio
Copy link

@valerie-rstudio valerie-rstudio commented Sep 27, 2021

Verified Fixed

RStudio Edition : Server
RStudio Version : 2021.12.0-daily+80
OS Version      : ubuntu20
R Version       : 4.0.3

Verified that the unwanted symbol conversions are now prevented by disabling the smart extension for the editor.

@GegznaV
Copy link

@GegznaV GegznaV commented Sep 28, 2021

  1. Can this behavior be set as the default in RStudio? (I mean, the default for a user and/or for a project).
  2. Is it documented? If yes, please, add the link to this thread.

@GegznaV
Copy link

@GegznaV GegznaV commented Sep 28, 2021

And how this be controlled in, e.g., bookdown projects, where .Rmd files of chapters do not contain YAML header. Is it sufficient to set this option in any of the setup files. E.g., in index.Rmd?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug visual markdown
Projects
None yet
Development

No branches or pull requests

4 participants