No-dependency, ESM based, in browser HTML to markdown converter.
A library that takes an HTML string or a reference to an Element and translates it to a Markdown code.
Note, this library works in a browser environment only. This won't work in Node.js
.
npm install --save @pawel-up/html.md
import HtmlMd from '@pawel-up/html.md';
const parser = new HtmlMd();
const markdown = parser.generate(`<p>This is a <code>markdown</code> output</p>`);
// This is a `markdown` output\n\n
import HtmlMd from '@pawel-up/html.md';
const parser = new HtmlMd();
const markdown = parser.generate(document.body);
Note, when passing an element, the most outer element is ignored and treated as a container. The generated markdown only contains child nodes.
git clone https://github.com/jarrodek/html.md
cd html.md
npm install
npm start
npm test
HTML.md by Pawel Uchida-Psztyc is licensed under CC BY 4.0