1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-20 18:48:28 +02:00
joplin/ReactNativeClient/lib/HtmlToMarkdownParser.js
2018-05-11 15:29:44 +01:00

16 lines
402 B
JavaScript

const { enexXmlToMd } = require('lib/import-enex-md-gen.js');
const stringToStream = require('string-to-stream')
class HtmlToMarkdownParser {
async parse(html, options = {}) {
if (!options.baseUrl) options.baseUrl = '';
const contentStream = stringToStream(html);
const markdown = await enexXmlToMd(contentStream, [], options);
return markdown;
}
}
module.exports = HtmlToMarkdownParser;