Skip to content

Commit

Permalink
fix: fix webclip detection
Browse files Browse the repository at this point in the history
  • Loading branch information
vzhd1701 committed Dec 19, 2021
1 parent b321b5e commit bb64e3c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion enex2notion/enex_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def _is_webclip(note_raw: dict):
return True

return bool(
re.match(
re.search(
'<div[^>]+style="[^"]+en-clipped-content[^"]*"', note_raw.get("content", "")
)
)
Expand Down
4 changes: 0 additions & 4 deletions enex2notion/note_parser_e_div.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ def parse_div(element: Tag):
logger.debug("Skipping task block")
return None

if "en-clipped-content" in style:
logger.debug("Skipping webclip block")
return None

# Google drive links
if "en-richlink" in style:
return parse_richlink(element)
Expand Down
8 changes: 2 additions & 6 deletions enex2notion/note_parser_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ def _is_div_special_block(element: Tag):
1. Code blocks
2. Task
3. Google drive links
4. Web Clipped content
"""

div_style = element.get("style")
div_style = element.get("style", "")

if not div_style:
return False
Expand All @@ -120,9 +119,6 @@ def _is_div_special_block(element: Tag):
"en-codeblock",
"en-task-group",
"en-richlink",
"en-clipped-content",
)

return any(
block_style in element.get("style", "") for block_style in special_block_styles
)
return any(block_style in div_style for block_style in special_block_styles)

0 comments on commit bb64e3c

Please sign in to comment.