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

Desktop: Fixes #5626: When web clipper clipping code blocks, keep code in multiline and delete code number lines (#10126)

Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
Co-authored-by: Henry Heino <46334387+personalizedrefrigerator@users.noreply.github.com>
This commit is contained in:
wljince007
2024-04-20 20:48:44 +08:00
committed by GitHub
parent ae1347bb7c
commit 294cc4a440
14 changed files with 318 additions and 35 deletions

View File

@@ -44,6 +44,15 @@ export default class HtmlToMd {
if (node.matches('object')) {
return pdfRule.replacement(content, node, {});
}
if (node.isCode) {
// Fix: Web clipper has trouble with code blocks on Joplin's website.
// See https://github.com/laurent22/joplin/pull/10126#issuecomment-2016523281 .
// If isCode, blank keep empty
// test case: packages/app-cli/tests/html_to_md/code_multiline_3.html
return '';
}
return '\n\n';
};
}