xml_to_md: Convert from CommonMark XML to (R) Markdown

xml_to_mdR Documentation

Convert from CommonMark XML to (R) Markdown

Description

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()

salim-b/pal documentation built on Feb. 28, 2025, 6:51 p.m.