From 9d7eaf911e749bb140d28882f944d5c4ae328d9a Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Tue, 6 Aug 2024 12:21:36 -0500 Subject: [PATCH] the header data may contain '/', e.g., book:dir/foo.Rmd --- R/preview.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/preview.R b/R/preview.R index 6bfe0dc..840e476 100644 --- a/R/preview.R +++ b/R/preview.R @@ -52,7 +52,7 @@ roam = function(dir = '.', live = TRUE, ...) in_dir(dir, { # we keep POSTing to the page assets' URLs, and if an asset file has been # modified, we return a response telling the browser to update it type = if (length(headers)) xfun::grep_sub( - '.*\nlitedown-data: ([:[:alnum:]]+).*', '\\1', rawToChar(headers) + '.*\nlitedown-data: ([^[:space:]]+).*', '\\1', rawToChar(headers) ) if (length(type) != 1) type = '' # we may need to check rawToChar(headers) to decide what to do for the