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

Quotation marks symbols are not the same if the code is wrapped in <code> or in backticks #10511

Closed
etiennebacher opened this issue Aug 14, 2024 · 3 comments
Labels
support a request for support

Comments

@etiennebacher
Copy link

Bug description

Not sure this is a bug, but the quotation mark symbols in code formatting are different depending on whether the code is wrapped in backticks or in HTML tags:

image

Steps to reproduce

---
format: html
---

No code formatting: "standard"

Code formatting with backticks: `"standard"`

Code formatting with HTML tag: <code>"standard"</code>

Expected behavior

I thought that wrapping code in <code> or in backticks would output the quotation marks appearing with backticks, i.e. I would expect both cases to output "standard", not the "curvy" quotation marks.


To give a bit more context, in altdoc, we convert .Rd files to Quarto files using tools::Rd2HTML() (among other things). Therefore, the .qmd file that is generated contains <code> tags, and not markdown formatting. When we render this file, the "curvy" quotation marks appear in the HTML output, just like in the example above. The problem is that those curvy quotation marks are not valid in R, e.g.:

image

meaning that they can't be copy-pasted. Therefore, I'd like the HTML output when using <code> tags to be the same as when using backticks.

Actual behavior

Quoted text that is wrapped in <code> or in backticks doesn't have the same quotation marks.

Your environment

  • IDE: RStudio, 2024.04.1 Build 748
  • R version 4.4.1 RC (2024-06-06 r86715 ucrt)
  • OS: Windows 10 x64 (build 19045)

Quarto check output

Quarto 1.5.56
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.2.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.41.0: OK
      Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.5.56
      Path: C:\Users\etienne\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: (not installed)

[>] Checking LaTeX....................OK
      Using: TinyTex
      Path: C:\Users\etienne\AppData\Roaming\TinyTeX\bin\windows\
      Version: 2024

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

[>] Checking Python 3 installation....(None)

      Unable to locate an installed version of Python 3.
      Install Python 3 from https://www.python.org/downloads/

[>] Checking R installation...........OK
      Version: 4.4.1
      Path: C:/Users/etienne/AppData/Local/Programs/R/R-4.4.1rc
      LibPaths:
        - C:/Users/etienne/AppData/Local/Programs/R/R-4.4.1rc/library
      knitr: 1.48
      rmarkdown: 2.27

[>] Checking Knitr engine render......OK
@etiennebacher etiennebacher added the bug Something isn't working label Aug 14, 2024
@mcanouil
Copy link
Collaborator

mcanouil commented Aug 14, 2024

That's Pandoc.

Note that it's unsafe to use raw code outside of raw blocks.
See and test https://quarto.org/docs/authoring/markdown-basics.html#raw-content

PS: if you don't know if it is a bug or not, you can open a discussion instead.

@etiennebacher
Copy link
Author

Thanks, closing then if this cannot be fixed on your side.

PS: if you don't know if it is a bug or not, you can open a discussion instead.

Noted, thank you

@etiennebacher etiennebacher closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2024
@mcanouil
Copy link
Collaborator

@etiennebacher To be clear, the side on which it can be fixed is yours, using the syntax I mentioned.

@mcanouil mcanouil added support a request for support and removed bug Something isn't working labels Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support a request for support
Projects
None yet
Development

No branches or pull requests

2 participants