Turn a character vector of lines into a single code block with each line
indented four spaces. This markdown leaf block can be rendered as nested HTML
<code> and <pre> tags. This is the code block format required by legacy
Reddit-flavored Markdown.
Usage
md_indent(x, n = 4)
Value
A glue object of length 1, with the elements of x preceded with
4 spaces and separated by a newline.
Arguments
x
A character vector of lines to be wrapped concatenated into a
single block, possibly created by readLines() or deparse().
n
A numeric vector
Details
An indented code block is composed of one or more indented chunks separated
by blank lines. An indented chunk is a sequence of non-blank lines, each
indented four or more spaces. The contents of the code block are the literal
contents of the lines, including trailing line endings, minus four spaces of
indentation. An indented code block has no info string.