You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-08-10 22:11:50 +02:00
Clipper: Fixes #12683: Fix web clipper fails to clip pages that include comments in inline styles (#12686)
This commit is contained in:
1
packages/app-cli/tests/html_to_md/comments_in_style.html
Normal file
1
packages/app-cli/tests/html_to_md/comments_in_style.html
Normal file
@@ -0,0 +1 @@
|
||||
<p><span style="/* Comment */ text-decoration: underline;">Test</span>. In the past, <span style="font-size: auto;/* Test! */">comments</span> in CSS have caused issues.</p>
|
1
packages/app-cli/tests/html_to_md/comments_in_style.md
Normal file
1
packages/app-cli/tests/html_to_md/comments_in_style.md
Normal file
@@ -0,0 +1 @@
|
||||
<ins>Test</ins>. In the past, comments in CSS have caused issues.
|
@@ -124,6 +124,8 @@ export function getStyleProp(node, name) {
|
||||
|
||||
const o = css.parse('div {' + style + '}');
|
||||
if (!o.stylesheet.rules.length) return null;
|
||||
const prop = o.stylesheet.rules[0].declarations.find(d => d.property.toLowerCase() === name);
|
||||
const prop = o.stylesheet.rules[0].declarations.find(d => {
|
||||
return d.type === 'declaration' && d.property.toLowerCase() === name;
|
||||
});
|
||||
return prop ? prop.value : null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user