@altairwei/wiz-markdown

Extract Markdown text embedded in WizNote document HTML.

Usage no npm install needed!

<script type="module">
  import altairweiWizMarkdown from 'https://cdn.skypack.dev/@altairwei/wiz-markdown';
</script>

README

Extract markdown source code from html:

const wizmarkdown = require("@altairwei/wiz-markdown");
const markdown = wizmarkdown.extract(html, {
    convertImgTag: true,
    verbose: true,
    skipNonBodyTag: false
});
console.log(markdown);

Embed markdown into html:

const wizmarkdown = require("@altairwei/wiz-markdown");
const html = wizmarkdown.embed(text, {
    escapeTabWithEntity: false, // default to replace `\t` with 4 `&nbsp;`
    wrapWithPreTag: true // Wrap markdown text within <pre> tag and perform only minimal character escaping
});
console.log(html);