Skip to contents

Convert from CommonMark XML to (R) Markdown

Usage

xml_to_md(xml)

Arguments

xml

CommonMark parse tree. An xml_document, xml_nodeset or xml_node.

Value

A character scalar.

See also

Other CommonMark parsing functions: md_to_xml(), md_xml_subnode_ix()

Examples

"# A title

Some prose.

## A subtitle

More prose.

## Another subtitle

Out of prose here.

### A sub-subtitle

I'm dug in.

# Another title

A last word." |>
  pal::md_to_xml() |>
  xml2::xml_contents() |>
  pal::xml_to_md() |>
  cat()
#> Warning: cannot open compressed file '/home/salim/.cache/pal-roxy_tag_value-tinkr/tinkr/DESCRIPTION', probable reason 'No such file or directory'
#> # A title
#> 
#> Some prose.
#> 
#> ## A subtitle
#> 
#> More prose.
#> 
#> ## Another subtitle
#> 
#> Out of prose here.
#> 
#> ### A sub-subtitle
#> 
#> I'm dug in.
#> 
#> # Another title
#> 
#> A last word.