Skip to content

Commit c56716b

Browse files
committed
Fix an edge case with ansi hyperlinks
```r cli::cli_text("{.path {''}}") ``` broke because the path became `NULL` in `parse_file_link_params()` and it was fed to `path.expand()` which failed.
1 parent 0c77fc5 commit c56716b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

R/ansi-hyperlink.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ parse_file_link_params <- function(txt) {
8989
matches <- re_match(txt, pattern)
9090
ret <- as.list(matches)
9191
ret[!nzchar(ret)] <- list(NULL)
92+
if (is.null(ret[["path"]])) ret[["path"]] <- ""
9293
ret
9394
}
9495

0 commit comments

Comments
 (0)