mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Clipper: Skip style section when importing HTML
This commit is contained in:
parent
f79d7b9626
commit
9db9d98419
13
CliClient/tests/html_to_md/list_with_many_items.html
Normal file
13
CliClient/tests/html_to_md/list_with_many_items.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Make sure in particular that indentation is correct after the 9th item -->
|
||||
<ol>
|
||||
<li><p>One</p><p>Two</p></li>
|
||||
<li><p>One</p><p>Two</p></li>
|
||||
<li><p>One</p><p>Two</p></li>
|
||||
<li><p>One</p><p>Two</p></li>
|
||||
<li><p>One</p><p>Two</p></li>
|
||||
<li><p>One</p><p>Two</p></li>
|
||||
<li><p>One</p><p>Two</p></li>
|
||||
<li><p>One</p><p>Two</p></li>
|
||||
<li><p>One</p><p>Two</p></li>
|
||||
<li><p>One</p><p>Two</p></li>
|
||||
</ol>
|
39
CliClient/tests/html_to_md/list_with_many_items.md
Normal file
39
CliClient/tests/html_to_md/list_with_many_items.md
Normal file
@ -0,0 +1,39 @@
|
||||
1. One
|
||||
|
||||
Two
|
||||
|
||||
2. One
|
||||
|
||||
Two
|
||||
|
||||
3. One
|
||||
|
||||
Two
|
||||
|
||||
4. One
|
||||
|
||||
Two
|
||||
|
||||
5. One
|
||||
|
||||
Two
|
||||
|
||||
6. One
|
||||
|
||||
Two
|
||||
|
||||
7. One
|
||||
|
||||
Two
|
||||
|
||||
8. One
|
||||
|
||||
Two
|
||||
|
||||
9. One
|
||||
|
||||
Two
|
||||
|
||||
10. One
|
||||
|
||||
Two
|
6
CliClient/tests/html_to_md/skip_style.html
Normal file
6
CliClient/tests/html_to_md/skip_style.html
Normal file
File diff suppressed because one or more lines are too long
0
CliClient/tests/html_to_md/skip_style.md
Normal file
0
CliClient/tests/html_to_md/skip_style.md
Normal file
40
ElectronClient/app/package-lock.json
generated
40
ElectronClient/app/package-lock.json
generated
@ -1204,9 +1204,9 @@
|
||||
"integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs="
|
||||
},
|
||||
"cssstyle": {
|
||||
"version": "0.2.37",
|
||||
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz",
|
||||
"integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=",
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.3.1.tgz",
|
||||
"integrity": "sha512-tNvaxM5blOnxanyxI6panOsnfiyLRj3HV4qjqqS45WPNS1usdYWRUQjqTEEELK73lpeP/1KoIGYUwrBn/VcECA==",
|
||||
"requires": {
|
||||
"cssom": "0.3.2"
|
||||
}
|
||||
@ -4027,11 +4027,11 @@
|
||||
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
|
||||
},
|
||||
"joplin-turndown": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/joplin-turndown/-/joplin-turndown-4.0.4.tgz",
|
||||
"integrity": "sha512-Qgi9DvLGT2r86yiQjKO83tvGYF9FabjVSnP6S9ts/+jaVWvwmBGhcGklFfMArlxY3doKZmdIPspiESsLcpn2Jg==",
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/joplin-turndown/-/joplin-turndown-4.0.5.tgz",
|
||||
"integrity": "sha512-LU5NxeNITCbW+s9XW/vkqJwKrrpbz3EfEa2fa8CuXjJgsWJVgvmg9R996r/1CEfV5VkJCCzmRxEEjqzYd2nzFA==",
|
||||
"requires": {
|
||||
"jsdom": "11.10.0"
|
||||
"jsdom": "11.11.0"
|
||||
}
|
||||
},
|
||||
"joplin-turndown-plugin-gfm": {
|
||||
@ -4061,22 +4061,22 @@
|
||||
"optional": true
|
||||
},
|
||||
"jsdom": {
|
||||
"version": "11.10.0",
|
||||
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.10.0.tgz",
|
||||
"integrity": "sha512-x5No5FpJgBg3j5aBwA8ka6eGuS5IxbC8FOkmyccKvObtFT0bDMict/LOxINZsZGZSfGdNomLZ/qRV9Bpq/GIBA==",
|
||||
"version": "11.11.0",
|
||||
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.11.0.tgz",
|
||||
"integrity": "sha512-ou1VyfjwsSuWkudGxb03FotDajxAto6USAlmMZjE2lc0jCznt7sBWkhfRBRaWwbnmDqdMSTKTLT5d9sBFkkM7A==",
|
||||
"requires": {
|
||||
"abab": "1.0.4",
|
||||
"acorn": "5.5.3",
|
||||
"acorn-globals": "4.1.0",
|
||||
"array-equal": "1.0.0",
|
||||
"cssom": "0.3.2",
|
||||
"cssstyle": "0.2.37",
|
||||
"cssstyle": "0.3.1",
|
||||
"data-urls": "1.0.0",
|
||||
"domexception": "1.0.1",
|
||||
"escodegen": "1.9.1",
|
||||
"html-encoding-sniffer": "1.0.2",
|
||||
"left-pad": "1.3.0",
|
||||
"nwmatcher": "1.4.4",
|
||||
"nwsapi": "2.0.0",
|
||||
"parse5": "4.0.0",
|
||||
"pn": "1.1.0",
|
||||
"request": "2.83.0",
|
||||
@ -4641,10 +4641,10 @@
|
||||
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
|
||||
"dev": true
|
||||
},
|
||||
"nwmatcher": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.4.tgz",
|
||||
"integrity": "sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ=="
|
||||
"nwsapi": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.0.0.tgz",
|
||||
"integrity": "sha512-9kj1oCEDNq+LHDAVPGDPg9+qRcBcpXb1IYC8q89jR8xJvOC2byQwEVsM3W1qQcSPVyzGGaXN7wZHnXORCiZl4w=="
|
||||
},
|
||||
"oauth-sign": {
|
||||
"version": "0.8.2",
|
||||
@ -6556,13 +6556,13 @@
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz",
|
||||
"integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=",
|
||||
"requires": {
|
||||
"punycode": "2.1.0"
|
||||
"punycode": "2.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"punycode": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz",
|
||||
"integrity": "sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0="
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
|
||||
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -89,7 +89,7 @@
|
||||
"highlight.js": "^9.12.0",
|
||||
"html-entities": "^1.2.1",
|
||||
"image-type": "^3.0.0",
|
||||
"joplin-turndown": "^4.0.4",
|
||||
"joplin-turndown": "^4.0.5",
|
||||
"joplin-turndown-plugin-gfm": "^1.0.6",
|
||||
"jssha": "^2.3.1",
|
||||
"katex": "^0.9.0-beta1",
|
||||
|
@ -10,6 +10,7 @@ class HtmlToMd {
|
||||
})
|
||||
turndown.use(turndownPluginGfm)
|
||||
turndown.remove('script');
|
||||
turndown.remove('style');
|
||||
let md = turndown.turndown(html)
|
||||
if (options.baseUrl) md = markdownUtils.prependBaseUrl(md, options.baseUrl);
|
||||
return md;
|
||||
|
@ -5,4 +5,4 @@ cd "$ROOT_DIR/CliClient/node_modules"
|
||||
rm -rf tkwidgets joplin-turndown joplin-turndown-plugin-gfm
|
||||
ln -s /mnt/d/Docs/PROGS/Node/tkwidgets/src tkwidgets
|
||||
ln -s /mnt/d/Temp/turndown-plugin-gfm joplin-turndown-plugin-gfm
|
||||
ln -s /mnt/d/Temp/turndown joplin-turndown
|
||||
ln -s /mnt/d/Temp/turndown joplin-turndown
|
Loading…
Reference in New Issue
Block a user