diff --git a/R/template.R b/R/template.R index 77221942e3..b021f170c9 100644 --- a/R/template.R +++ b/R/template.R @@ -71,7 +71,7 @@ stitch = function(script, message('PDF output at: ', with_ext(out, 'pdf')) }, md = { out.html = with_ext(out, 'html') - mark_html(out, out.html) + markdown::mark_html(out, out.html) message('HTML output at: ', out.html) }) out diff --git a/R/utils-conversion.R b/R/utils-conversion.R index 2a941ffe7f..97ea6175b9 100644 --- a/R/utils-conversion.R +++ b/R/utils-conversion.R @@ -168,16 +168,9 @@ knit2html = function( out = knit(input, text = text, envir = envir, quiet = quiet) if (is.null(text)) { output = with_ext(if (is.null(output) || is.na(output)) out else output, 'html') - mark_html(out, output, ...) + markdown::mark_html(out, output, ...) invisible(output) - } else mark_html(text = out, ...) -} - -mark_html = function(...) { - if (packageVersion('markdown') < '1.3') stop( - "The 'markdown' package version >= 1.3 is required." - ) - markdown::mark_html(...) + } else markdown::mark_html(text = out, ...) } #' Knit an R Markdown document and post it to WordPress @@ -225,7 +218,7 @@ knit2wp = function( ) out = knit(input, envir = envir); on.exit(unlink(out)) content = file_string(out) - content = mark_html(text = content) + content = markdown::mark(text = content) shortcode = rep(shortcode, length.out = 2L) if (shortcode[1]) content = gsub( '
(.+?)
',
diff --git a/R/utils-rd2html.R b/R/utils-rd2html.R
index ae16c10b6a..e57d4c3159 100644
--- a/R/utils-rd2html.R
+++ b/R/utils-rd2html.R
@@ -66,7 +66,7 @@ knit_rd = function(pkg, links = tools::findHTMLlinks(), frame = TRUE) {
toc = sprintf('- %s', paste0(topics, '.html'), topics)
toc = c(paste0('# ', pkg), '', toc, '',
paste('Generated with [knitr](https://yihui.org/knitr) ', packageVersion('knitr')))
- mark_html(text = toc, output = '00frame_toc.html', meta = list(
+ markdown::mark_html(text = toc, output = '00frame_toc.html', meta = list(
title = paste('R Documentation of', pkg), css = 'R.css'
))
txt = read_utf8(file.path(find.package(pkg), 'html', '00Index.html'))