Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

also detect Pandoc's inline raw attributes to determine if Pandoc should be run #585

Merged
merged 2 commits into from Feb 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -274,7 +274,7 @@ markdown_format = function() get_option(
run_pandoc = function(x) {
!is.null(get_option('blogdown.markdown.format')) ||
length(grep('^(references|bibliography):($| )', x)) ||
length(grep('^[`]{3,}\\{=[[:alnum:]]+}$', x))
length(grep('[`]{1,}\\{=[[:alnum:]]+}', x))
}

# given the content of a .html file: replace content/*_files/figure-html with
@@ -0,0 +1,13 @@
library(testit)

assert('run_pandoc() find when Pandoc needs to convert', {
(run_pandoc(c("nothing special", "requiring render")) %==% FALSE)
(run_pandoc(c("```{=html}", "using raw block content", "```")) %==% TRUE)
cderv marked this conversation as resolved.
Show resolved Hide resolved
(run_pandoc(c("With inline raw `this works too`{=html}")) %==% TRUE)
(run_pandoc(c("Using bib", "references:")) %==% TRUE)
(run_pandoc(c("Using bib", "bibliography: test.bib")) %==% TRUE)
opts = options(blogdown.markdown.format = "gfm")
(run_pandoc(c("nothing special", "but option is set")) %==% TRUE)
options(opts)
})