Learn R Programming

roxygen2 (version 8.0.0)

escape_rd_for_md: Escape fragile Rd tags

Description

escape_rd_for_md() replaces fragile Rd tags with placeholders, to avoid interpreting them as markdown. unescape_rd_for_md() puts the original text back in place of the placeholders after the markdown parsing is done. The fragile tags are listed in escaped_for_md.

Some Rd macros are treated specially:

  • For if, markdown is only allowed in the second argument.

  • For ifelse markdown is allowed in the second and third arguments.

Usage

escape_rd_for_md(text)

unescape_rd_for_md(rd_text, esc_text)

Value

  • escape_rd_for_md: a "safe" version of the input text, where each fragile Rd tag is replaced by a placeholder. The original text is added as an attribute for each placeholder.

  • unescape_rd_for_md: the original Rd text.

Arguments

text

Input text. Potentially contains Rd and/or markdown markup.

rd_text

The markdown parsed and interpreted text.

esc_text

The original escaped text from escape_rd_for_md().