strip_md | R Documentation |
Removes all Markdown formatting from a character vector.
strip_md(x, strip_footnotes = TRUE)
x |
A character vector to strip Markdown formatting from. |
strip_footnotes |
Whether to remove Markdown footnotes, too. If |
This function relies on commonmark::markdown_text()
which supports the CommonMark specification plus the Github extensions. Unfortunately, Markdown footnotes can't be stripped
using commonmark::markdown_text()
. Therefore a separate option strip_footnotes
is offered which relies on regular expressions to remove inline footnotes
and footnote definitions and references.
A character vector of the same length as x
.
Other (Pandoc) Markdown functions:
as_md_list()
,
as_md_val_list()
,
as_md_vals()
,
md_verb()
,
pipe_table()
,
strip_md_footnotes()
pal::strip_md(
"A **MD** formatted [string](https://en.wikipedia.org/wiki/String_(computer_science))"
)
# link references are only removed *iff* the reference is included in `x`:
pal::strip_md("[A reference link][refid]\n\n[refid]: https://example.com")
pal::strip_md("[A reference link][refid]\n\n_No ref here..._")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.