Skip to content

Commit

Permalink
fixes for single line chunk start/end syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
richierocks committed Apr 12, 2013
1 parent a9b822a commit 876303a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions R/hooks-asciidoc.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @rdname hook_plot
#' @rdname hook_plot
#' @export
hook_plot_asciidoc = function(x, options) {
base = opts_knit$get('base.url') %n% ''
Expand Down Expand Up @@ -52,7 +52,7 @@ render_asciidoc = function() {
sprintf('+%s+', x)
}
hook.chunk = function(x, options) {
x = gsub("-{4,}", "----", x)
x = gsub("/{2,}", "", x)
if (is.null(s = options$indent)) return(x)
line_prompt(x, prompt = s, continue = s)
}
Expand Down
6 changes: 3 additions & 3 deletions R/pattern.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' All built-in patterns
#' All built-in patterns
#'
#' This object is a named list of all built-in patterns.
#' @references Usage: \url{http://yihui.name/knitr/patterns}
Expand Down Expand Up @@ -42,8 +42,8 @@ all_patterns = list(
ref.chunk = "^\\.*\\s*<<(.+)>>\\s*$",
inline.code = ":r:`([^`]+)`"),

`asciidoc` = list(chunk.begin = '^/{4,}\\s*\\n\\[r,(.*)\\]$',
chunk.end = '/-{4,}\\s*$',
`asciidoc` = list(chunk.begin = '^/{2}\\s*begin\\.rcode$',
chunk.end = '^/{2}\\s*end\\.rcode$',
ref.chunk = '^\\s*<<(.+)>>\\s*$',
inline.code = '`r +([^`\n]+)\\s*`',
inline.comment = '^//.*',
Expand Down

0 comments on commit 876303a

Please sign in to comment.