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

Use glue's .literal argument #383

Closed
wants to merge 1 commit into from
Closed

Conversation

jennybc
Copy link
Member

@jennybc jennybc commented Dec 16, 2021

Fixes #370

This is a rather quick / naive PR, but I just want to demo that the new .literal argument of glue allows #370 to be addressed.

These are results with dev glue and this PR:

Update: the new .literal argument now exists in glue 1.6.0, released on CRAN 2021-12-17.

#pak::pkg_install("tidyverse/glue")
library(glue)
devtools::load_all("~/rrr/cli")
#> ℹ Loading cli

packageVersion("glue")
#> [1] '1.5.1.9000'

cli_dl(
  c(
    "test_1" = "all good",
    "test_2" = "not #good (ok now!)",
    "test_3" = "no' good either (ok now!)",
    "test_4" = "no\" good also (ok now!)"
  )
)
#> test_1: all good
#> test_2: not #good (ok now!)
#> test_3: no' good either (ok now!)
#> test_4: no" good also (ok now!)

cli::cli_alert_success("Qapla'")
#> ✓ Qapla'

cli::cli_text("{.url https://example.com/#section}")
#> <https://example.com/#section>

Created on 2021-12-15 by the reprex package (v2.0.1.9000)

@codecov-commenter
Copy link

Codecov Report

Merging #383 (5c2904c) into main (aaf7cf1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #383   +/-   ##
=======================================
  Coverage   78.77%   78.77%           
=======================================
  Files          71       71           
  Lines        4994     4995    +1     
=======================================
+ Hits         3934     3935    +1     
  Misses       1060     1060           
Impacted Files Coverage Δ
R/inline.R 94.11% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aaf7cf1...5c2904c. Read the comment docs.

@gaborcsardi
Copy link
Member

Thanks! .literal is indeed great, and I did this in 64a389e with some other changes (and then mistakenly closed this PR with it).

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

Successfully merging this pull request may close these issues.

cl_dl output is missing if string contains # or '
3 participants