diff --git a/R/markdown.R b/R/markdown.R index b79c305..b0a82e0 100644 --- a/R/markdown.R +++ b/R/markdown.R @@ -14,8 +14,8 @@ prose_index = function(x, warn = TRUE) { idx = NULL # if raw HTML
exists, it should be treated as code block - inside_pre = if (length(p1 <- grep('', x))) { - p2 = grep('', x) + inside_pre = if (length(p1 <- grep('^\\s*
', x))) { + p2 = grep('\\s*$', x) if (length(p1) == length(p2)) { idx = rbind(p1, p2) function(i) any(i > p1 & i < p2)