-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior
Description
I have a slightly odd use case where I was trying to "pluralize" the verb exist and ran into the an issue where {?s/} is being treated as {?s}.
vars = c("X")
cli::cli_text("{vars} exist{?s/}")
#> X exist
cli::cli_text("{vars} exist{?s}")
#> X exist
vars = c("X","Y")
cli::cli_text("{vars} exist{?s/}")
#> X and Y exists
cli::cli_text("{vars} exist{?s}")
#> X and Y exists
it seems like this may be a more general issue with a trailing empty alternative:
vars = c()
cli::cli_text("{vars} word{?A/B/C}") # Ok
#> wordA
cli::cli_text("{vars} word{?/B/C}") # Ok
#> word
cli::cli_text("{vars} word{?A//C}") # Ok
#> wordA
cli::cli_text("{vars} word{?A/B/}") # Wrong
#> wordB
vars = c("X")
cli::cli_text("{vars} word{?A/B/C}") # Ok
#> X wordB
cli::cli_text("{vars} word{?/B/C}") # Ok
#> X wordB
cli::cli_text("{vars} word{?A//C}") # Ok
#> X word
cli::cli_text("{vars} word{?A/B/}") # Wrong
#> X wordA
vars = c("X","Y")
cli::cli_text("{vars} word{?A/B/C}") # Ok
#> X and Y wordC
cli::cli_text("{vars} word{?/B/C}") # Ok
#> X and Y wordC
cli::cli_text("{vars} word{?A//C}") # Ok
#> X and Y wordC
cli::cli_text("{vars} word{?A/B/}") # Wrong
#> X and Y wordB
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior