Apply highlight style for Quarto/Word output

Description

Wraps text in Quarto custom style span for highlighting in Word documents.

Usage

highlight_text(text, style = "highlight-yellow", apply = TRUE)

Arguments

text Text to highlight.
style Custom style name. Default "highlight-yellow".
apply If FALSE, return text unchanged.

Value

Character string with Quarto custom style span.

Examples

library("psych350lab")

highlight_text("Answer here", apply = TRUE)
[1] "[Answer here]{custom-style=\"highlight-yellow\"}"
highlight_text("Answer here", style = "highlight-blue")
[1] "[Answer here]{custom-style=\"highlight-blue\"}"