From 8431e7d20fb12aa05da0836ebc07cf6af80786c8 Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Mon, 8 Apr 2013 02:53:37 -0500 Subject: [PATCH] when there is only one field in config, should drop(cfg) to make it a vector --- R/pandoc.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/pandoc.R b/R/pandoc.R index b4201f616b..0e743987e6 100644 --- a/R/pandoc.R +++ b/R/pandoc.R @@ -38,7 +38,7 @@ pandoc = function(input, format = 'html', config = getOption('config.pandoc')) { cfg = read.dcf(con) if (nrow(cfg) == 0L) cfg = character(0) else if (nrow(cfg) == 1L) { if ('format' %in% colnames(cfg)) { - if (cfg[1L, 'format'] != format) cfg = NA + cfg = if (cfg[1L, 'format'] == format) drop(cfg) else NA } else {cmn = drop(cfg); cfg = NA} } else { if (!('format' %in% colnames(cfg)))