rstudio / rmarkdown

Dynamic Documents for R
https://rmarkdown.rstudio.com
GNU General Public License v3.0
2.87k stars 977 forks source link

html tag <!-- inserted when commenting out bash code instead of # #2511

Closed Sherry520 closed 1 year ago

Sherry520 commented 1 year ago

The question is issued in Rstudio, but it may be the problem of rmarkdown.

https://github.com/rstudio/rstudio/issues/10800

Hi there,

I noticed that bash comments are not handled correctly in code chunks. I'm not sure which project is responsible for the situation (rmarkdown, rstudio, something else?). I submit it here since comments are well handled in .sh files in rstudio.

Reproducible example

  1. Create an Rmd file (I used github_template but any output will do)

  2. Insert the following code chunk:

    ```{bash}
    echo hello world
  3. comment the line out with the CTRL+SHIFT+C shortcut

    Actual result

    ```{bash}
    <!-- echo hello world -->
    ### Expected result
    # echo hello world
    ### Session info

    R version 4.1.3 (2022-03-10) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Debian GNU/Linux 11 (bullseye), RStudio 2022.2.0.443

Locale: LC_CTYPE=fr_FR.UTF-8 LC_NUMERIC=C LC_TIME=fr_FR.UTF-8 LC_COLLATE=fr_FR.UTF-8 LC_MONETARY=fr_FR.UTF-8 LC_MESSAGES=fr_FR.UTF-8
LC_PAPER=fr_FR.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C

Package version: base64enc_0.1.3 bslib_0.3.1 digest_0.6.29 evaluate_0.15 fastmap_1.1.0 fs_1.5.2 glue_1.6.2 graphics_4.1.3 grDevices_4.1.3 highr_0.9
htmltools_0.5.2 jquerylib_0.1.4 jsonlite_1.8.0 knitr_1.37 magrittr_2.0.2 markdown_1.1 methods_4.1.3 mime_0.12 R6_2.5.1 rappdirs_0.3.3 rlang_1.0.2 rmarkdown_2.13 sass_0.4.0 stats_4.1.3 stringi_1.7.6 stringr_1.4.0 tinytex_0.37 tools_4.1.3 utils_4.1.3 xfun_0.30
yaml_2.3.5

Pandoc version: 2.17.1.1


<!--
Welcome to the rmarkdown GitHub repo!

We are always happy to hear feedback from our users. 

To file a _bug report_, please follow these instructions carefully: <https://yihui.org/issue/#bug-reports>

Also, please complete and keep the checklist below in your issue. This helps you know what to check for opening a good issue report. It also helps know that you've have done the common steps that can solve your potential issue.

At last, if you have posted the same issue elsewhere, please mentioned it (with a link to the other issue).

-->

## Checklist

When filing a _bug report_, please check the boxes below to confirm that you have provided us with the information we need. Have you:

- [ ] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?

- [ ] included a minimal, self-contained, and reproducible example?

- [ ] pasted the output from `xfun::session_info('rmarkdown')` in your issue?

- [ ] upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?

- [ ] installed and tested your bug with the development version of the rmarkdown package using `remotes::install_github("rstudio/rmarkdown")`?
cderv commented 1 year ago

No this is an issue with RStudio IDE directly like described in https://github.com/rstudio/rstudio/issues/10800

comment the line out with the CTRL+SHIFT+C shortcut

This feature is implemented by the IDE. I'll close this and you should follow there.

github-actions[bot] commented 7 months ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.