Skip to content

Commit b32724c

Browse files
committed
cosmetic
1 parent f8f662b commit b32724c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

R/render.R

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -900,15 +900,12 @@ render <- function(input,
900900
# render to temporary file (preserve extension)
901901
# this also ensures we don't pass a file path with invalid
902902
# characters to our pandoc invocation
903-
file_ext <- xfun::file_ext(output)
904-
ext <- if (nzchar(file_ext))
905-
paste(".", file_ext, sep = "")
906-
else
907-
""
903+
ext <- xfun::file_ext(output)
904+
if (ext != '') ext <- paste0('.', ext)
908905

909906
# render to a path in the current working directory
910907
# (avoid passing invalid characters to shell)
911-
pandoc_output_tmp <- basename(tempfile("pandoc", tmpdir = getwd(), fileext = ext))
908+
pandoc_output_tmp <- basename(tempfile("pandoc", getwd(), ext))
912909

913910
# clean up temporary file on exit
914911
on.exit(unlink(pandoc_output_tmp), add = TRUE)

0 commit comments

Comments
 (0)