add_nl_around_md_blocks: Add a newline block on either side of block elements

View source: R/map_rd2markdown.R

add_nl_around_md_blocksR Documentation

Add a newline block on either side of block elements

Description

Add newline elements such that each block element is surrounded by one newline. Will not add newlines where one already exists.

Usage

add_nl_around_md_blocks(x)

Arguments

x

list of markdown elements, either strings or md_tag elements

Examples

## Not run: 
x <- list("p1", nl(2), "p2", block("list1"), block("list2"))
add_nl_around_md_blocks(x)
# list("p1", nl(2), "p2", nl(1), block("list1"), nl(1), block("list2"))
#                           ^                      ^

## End(Not run)


Genentech/rd2markdown documentation built on Feb. 28, 2025, 1:27 p.m.