Skip to content

Commit

Permalink
out_format() could be empty, too (when running outside knit())
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Feb 16, 2023
1 parent 05f2195 commit 78f1db5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ is_latex_output = function() {
#' @rdname output_type
#' @export
is_html_output = function(fmt = pandoc_to(), excludes = NULL) {
if (length(fmt) == 0) fmt = out_format()
fmt = fmt %n% out_format()
if (length(fmt) == 0) return(FALSE)
if (grepl('^markdown', fmt)) fmt = 'markdown'
if (fmt == 'epub3') fmt = 'epub'
fmts = c('markdown', 'epub', 'epub2', 'html', 'html4', 'html5', 'revealjs', 's5', 'slideous', 'slidy', 'gfm')
Expand Down

0 comments on commit 78f1db5

Please sign in to comment.