You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-12-05 22:57:29 +02:00
Clipper: Download images and convert them to resources
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
const TurndownService = require('joplin-turndown')
|
||||
const markdownUtils = require('lib/markdownUtils');
|
||||
|
||||
class HtmlToMd {
|
||||
|
||||
parse(html) {
|
||||
parse(html, options = {}) {
|
||||
const turndownPluginGfm = require('joplin-turndown-plugin-gfm').gfm
|
||||
const turndown = new TurndownService({
|
||||
headingStyle: 'atx',
|
||||
})
|
||||
turndown.use(turndownPluginGfm)
|
||||
turndown.remove('script');
|
||||
let markdown = turndown.turndown(html)
|
||||
return markdown;
|
||||
let md = turndown.turndown(html)
|
||||
if (options.baseUrl) md = markdownUtils.prependBaseUrl(md, options.baseUrl);
|
||||
return md;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user