You've already forked joplin
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:
16
ReactNativeClient/lib/HtmlToMarkdownParser.js
Normal file
16
ReactNativeClient/lib/HtmlToMarkdownParser.js
Normal 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;
|
Reference in New Issue
Block a user