altairwei / wiz-markdown

Extract Markdown text embedded in WizNote document HTML.
MIT License
1 stars 0 forks source link

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 ` `
    wrapWithPreTag: true // Wrap markdown text within <pre> tag and perform only minimal character escaping
});
console.log(html);