mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-20 18:48:28 +02:00
16 lines
402 B
JavaScript
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; |