Skip to contents

Recursively converts the specified columns from Markdown to HTML using commonmark::markdown_html(). Columns to be converted must be of (nested) type character.

Usage

htmlize_qstnr(
  qstnr,
  cols = c("title", "description", "question"),
  cols_rm_p = "values",
  hard_line_breaks = FALSE,
  smart_punctuation = TRUE,
  strip_footnotes = TRUE,
  normalize = TRUE,
  extensions = c("table", "strikethrough", "tasklist")
)

Arguments

qstnr

Semi-unnested questionnaire tibble as returned by unnest_qstnr().

cols

Column names to convert to HTML. All columns must be of type character. Mustn't overlap with cols_rm_p. Tidy selections are supported.

cols_rm_p

Columns names to convert to HTML without the outer <p> tag. All columns must be of type character. Mustn't overlap with cols. Tidy selections are supported.

hard_line_breaks

Whether or not to interpret all newlines within a paragraph as hard line breaks instead of spaces. This setting conforms to Pandoc's hard_line_breaks extension.

smart_punctuation

Whether or not to enable smart punctation conforming to Pandoc's smart extension which converts straight quotes to curly quotes, --- to an em-dash (—), -- to an en-dash (–), and ... to ellipses (…). It also replaces regular spaces after certain abbreviations such as Mr. with non-breaking spaces.

strip_footnotes

Whether or not to remove Markdown footnotes.

normalize

Consolidate adjacent text nodes.

extensions

Enables Github extensions. Can be TRUE (all) FALSE (none) or a character vector with a subset of available extensions.

Value

qstnr with values in cols converted to HTML text.

See also

Other questionnaire generation functions: gen_qmd_qstnr(), gen_qstnr(), gen_qstnr_docs(), unnest_qstnr(), unnest_qstnr_vals()