library(knitr)
out = c("*hello*", raw_output("content *protect* me!"),
"*world*")
pre = extract_raw_output(out)
str(pre)
pre$value = gsub("[*]([^*]+)[*]", "\\1",
pre$value) # think this as Pandoc conversion
pre$value
# raw output was protected from the conversion
# (e.g. *protect* was not converted)
restore_raw_output(pre$value, pre$chunks)
Run the code above in your browser using DataLab