You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-18 23:07:45 +02:00
Desktop, Cli: Fixed various bugs related to the import of ENEX files as HTML
This commit is contained in:
@ -7,6 +7,28 @@ const htmlentities = new Entities().encode;
|
||||
const imageRegex = /<img([\s\S]*?)src=["']([\s\S]*?)["']([\s\S]*?)>/gi;
|
||||
const anchorRegex = /<a([\s\S]*?)href=["']([\s\S]*?)["']([\s\S]*?)>/gi;
|
||||
|
||||
const selfClosingElements = [
|
||||
'area',
|
||||
'base',
|
||||
'basefont',
|
||||
'br',
|
||||
'col',
|
||||
'command',
|
||||
'embed',
|
||||
'frame',
|
||||
'hr',
|
||||
'img',
|
||||
'input',
|
||||
'isindex',
|
||||
'keygen',
|
||||
'link',
|
||||
'meta',
|
||||
'param',
|
||||
'source',
|
||||
'track',
|
||||
'wbr',
|
||||
];
|
||||
|
||||
class HtmlUtils {
|
||||
headAndBodyHtml(doc) {
|
||||
const output = [];
|
||||
@ -15,6 +37,10 @@ class HtmlUtils {
|
||||
return output.join('\n');
|
||||
}
|
||||
|
||||
isSelfClosingTag(tagName) {
|
||||
return selfClosingElements.includes(tagName.toLowerCase());
|
||||
}
|
||||
|
||||
extractImageUrls(html) {
|
||||
if (!html) return [];
|
||||
|
||||
|
Reference in New Issue
Block a user