# htmlPreserve will prevent ""
# from getting an tag inserted in the middle
markup <- paste(sep = "\n",
"This is *emphasized* text in markdown.",
htmlPreserve(""),
"Here is some more *emphasized text*."
)
extracted <- extractPreserveChunks(markup)
markup <- extracted$value
# Just think of this next line as Markdown processing
output <- gsub("\\*(.*?)\\*", "\\1", markup)
output <- restorePreserveChunks(output, extracted$chunks)
output
Run the code above in your browser using DataLab