View source: R/get_protected.R
get_protected | R Documentation |
Get protected nodes
get_protected(body, type = NULL, ns = md_ns())
body |
an |
type |
a character vector listing the protections to be included.
Defaults to
|
ns |
the namespace of the document (defaults to |
an xml_nodelist
object.
path <- system.file("extdata", "basic-curly.md", package = "tinkr")
ex <- tinkr::yarn$new(path, sourcepos = TRUE)
# protect curly braces
ex$protect_curly()
# add math and protect it
ex$add_md(c("## math\n",
"$c^2 = a^2 + b^2$\n",
"$$",
"\\sum_{i}^k = x_i + 1",
"$$\n")
)
ex$protect_math()
# get protected now shows all the protected nodes
get_protected(ex$body)
get_protected(ex$body, c("math", "curly")) # only show the math and curly
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.