md <- glue::glue("
h1
====
::: section
h2
----
section *text* with [a link](https://ropensci.org/)
:::
")
x <- xml2::read_xml(commonmark::markdown_xml(md))
ns <- xml2::xml_ns_rename(xml2::xml_ns(x), d1 = "md")
res <- find_between(x, ns)
res
xml2::xml_text(res)
xml2::xml_find_all(res, ".//descendant-or-self::md:*", ns = ns)
Run the code above in your browser using DataLab