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

syntax highlighting for native pipe |> #389

Closed
stragu opened this issue Aug 16, 2021 · 2 comments
Closed

syntax highlighting for native pipe |> #389

stragu opened this issue Aug 16, 2021 · 2 comments

Comments

@stragu
Copy link

stragu commented Aug 16, 2021

Currently, using the default syntax highlighting, the native pipe is highlighted as separate | and >. The following:

library(magrittr)
1.23 %>% round()
#> [1] 1
1.23 |> round()
#> [1] 1

Created on 2021-08-16 by the reprex package (v2.0.1)

Results in this in the viewer:

image

It would be great to support highlighting the native pipe as a distinct operator.

@cderv
Copy link
Contributor

cderv commented Aug 16, 2021

I believe this should be solved in rmarkdown directly. We already released (in rmarkdown 2.10) a quick fix for html_document() related output, but I don't think reprex is using html_document() or html_document_base() to render the HTML preview. It is the same for github_document() - the highlighting oddity still remains.

We plan to make a proper fix that reprex could benefit. We are tracking this in rstudio/rmarkdown#2196

@jennybc
Copy link
Member

jennybc commented Aug 16, 2022

Looks like reprex just needs to wait for the upstream fixes to happen, as described above. It's really not something the reprex package has control over.

@jennybc jennybc closed this as completed Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants