1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

All: Various changes to improve import of HTML

This commit is contained in:
Laurent Cozic
2018-05-11 15:29:44 +01:00
parent 482e9340bc
commit bac68f2c42
3 changed files with 111 additions and 16 deletions

View File

@ -0,0 +1,16 @@
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;