raw_text: Mark a character vector as raw output

raw_textR Documentation

Mark a character vector as raw output

Description

This function should be called inside a code chunk, and its effect is the same as the chunk option results = "asis". The input character vector will be written verbatim to the output (and interpreted as Markdown).

Usage

raw_text(x, format = NULL)

Arguments

x

A character vector (each element will be treated as a line).

format

An output format name, e.g., html or latex. If provided, x will be wrapped in a fenced code block, e.g., ⁠ ```{=html}⁠.

Value

A character vector with a special class to indicate that it should be treated as raw output.

Examples

litedown::raw_text(c("**This**", "_is_", "[Markdown](#)."))
litedown::raw_text("<b>Bold</b>", "html")
litedown::raw_text("\\textbf{Bold}", "latex")

litedown documentation built on April 12, 2025, 1:34 a.m.