tagger: Surrounds text with tags unless empty

View source: R/formatting.R

taggerR Documentation

Surrounds text with tags unless empty

Description

Surrounds text with tags unless empty

Usage

tagger(x, tag = "<span>", right_tag = gsub("^<", "</", tag))

bold_md(x)

italic_md(x)

superscript_md(x)

subscript_md(x)

header_md(x, level = 1)

Arguments

x

character vector

tag

opening tag, e.g., ⁠<span>⁠ or ⁠**⁠

right_tag

closing tag. By default, the opening tag with < replaced by ⁠</⁠ (e.g., ⁠<span>⁠ becomes ⁠</span>⁠), so markdown tags such as ⁠**⁠ close with themselves.

level

heading level

Value

character vector

Examples

x <- c("hello", "", NA)
tagger(x, "<span>")
bold_md(x)
italic_md(x)
superscript_md(x)
subscript_md(x)
header_md("Level 1")
header_md("Level 2", 2)

apa7 documentation built on Dec. 1, 2026, 5:06 p.m.